TEST TEST

Find & Replace

iaian7 » blog   John Einselen, 16.02.11    

Though I rather like Safari’s find feature (command+f brings up the search bar, or command+g to find again without even opening the UI), there are countless times when I’ve needed a good find & replace function. Copying content into TextWrangler just to do basic text replacement is a huge hassle! Though a dedicated extension would be really nice, I figured a simple bookmarklet could do the trick. Sadly, after a few minutes of searching via Google, I didn’t find much; a few examples, but they attempted to modify all page elements, or were incomplete. I needed something more reliable for editing content only within the currently selected input or text field. So I wrote my own.

The following code should work in most modern browsers (though I’ve only tested it in Safari), and even escapes most regex special character to help prevent weird errors (solution via simonwillison.net).

javascript: var el=document.activeElement; if(el.value){ var findVal=prompt('Find this:',''); if(findVal){ var findRegex=new RegExp(findVal.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,'\\$&'),'gi'); var resultsNumber=el.value.match(findRegex); if(resultsNumber){ var replaceVal=prompt('Replace with:',''); if(replaceVal){ if(confirm('Are you sure you want to replace '+resultsNumber.length+' occurances of %22'+findVal+'%22 with %22'+replaceVal+'%22?'))el.value=el.value.replace(findRegex,replaceVal); } }else{alert('Sorry, no matches found for %22'+findVal+'%22');} } }else{alert('Sorry, no text field is selected');}

To use it yourself, just drag the following link into your bookmark bar (the script has been compressed for brevity’s sake).

1browser bookmarklet

Keep in mind this is offered with no guarantees; you accept full responsibility, and I recommend saving your data first, just in case.

Make sure the desired text field is active, then click the bookmark to start the process. If it’s one of the first nine bookmarks, you can even use a keyboard shortcut to activate it by pressing command+[number key] (bookmarks are numbered starting with 1). The script will ask for the search term, the replacement term, and confirmation (along with the final number of terms being replaced). You can cancel at any point by simply pressing the escape key, and the script double checks the validity of the input at every step. For example, if you enter a search term that’s not present, the script will interrupt before you waste any time entering the desired replacement term. Nice!

There is one known limitation: it doesn’t work with text fields inside an iFrame. Without helper scripts embedded in the parent page, it can’t tell there’s a completely different HTML document it should be paying attention too.

bookmark  

Iconifer

iaian7 » code » dashboard   John Einselen, 12.01.11    

Helpful OSX Dashboard widget for converting images into iOS, Mac, and/or Windows icon formats. Automatically generates iTunes, iPhone 4, iPad, and iPhone PNG files, or outputs ICNS or ICO files with all necessary sizes.

read more

Identity

iaian7 » blog   John Einselen, 1.10.10    

Earlier this year at Bridge Community Church, Pastor Vinson preached a series on our identity in Christ. Though various ideas were tossed around in one of the planning meetings, an illustration concept was eventually developed based on the concept of reflections revealing truth. Proverbs 27:19 likens our hearts to pools of water, reflecting the real us. So what does that mean for Christians?

Ephesians 5:8 NLT
For once you were full of darkness, but now you have light from the Lord. So live as people of light!

It’s transformative! Our identity need no longer be defined by our past, by our failures, by our dirty sins. Washed clean, our identity is all holiness, righteousness, completeness in Christ. Even living in a dark and crumbling world, our spiritual reality is far different.

Romans 3:24 NLT
Yet God, with undeserved kindness, declares that we are righteous. He did this through Christ Jesus when he freed us from the penalty for our sins.

Titus 3:7 NLT
Because of his grace he declared us righteous and gave us confidence that we will inherit eternal life.

It took a couple weekends of test shots, and several more to get the final photoshoots completed, but the illustrations slowly came together. Using a medium format lens and my DSLR, local rows of trees were captured then stitched together into a high resolution 16bit comp. Depth mapping was hand painted to help merge the trees with stock photography for the dramatically unreal skies, and along with shots of a nearby grassy bank, the environments took shape. Jim and Adrianne graciously volunteered to model, and yet a few more weekends later, the final compositing was done.

Complete in Christ::Adrianne   Complete in Christ::Jim

As I’ve written before, this is a concept I’m still struggling to grasp myself. Some days it seems too good to be true, and I deny reality; how could God be that forgiving? Other days I’m simply too distracted to remember who I am; living not as an adopted son of wealthy means, but as an ignorant pauper. Pastor Vinson calls it divine amnesia, forgetting what we’ve been freely given.

Ephesians 1:18 NLT
I pray that your hearts will be flooded with light so that you can understand the confident hope he has given to those he called—his holy people who are his rich and glorious inheritance.

1 Corinthians 4:18 NIV
So we fix our eyes not on what is seen, but on what is unseen. For what is seen is temporary, but what is unseen is eternal.

And yet, amidst all the glory of our identity in Christ, there’s even more yet to see! Speaking again of mirrors, Paul likens in 1 Corinthians 13:12 our current understanding to a dim reflection; incomplete and incomparable to the vastness of what is to come!

bookmark  

I don't know how to stop!

iaian7 » blog   John Einselen, 25.09.10    

I’ve been seeing and hearing more about the illusion of multitasking in the human brain for several months; after the publication of a research paper or two, there was the NPR special on how the human brain works…then I heard about Vitamin R, an application designed to segment work break schedules, and other apps for minimising distractions. Today Andy Ihnatko’s article on distractions and multitasking was posted to the Chicago Sun-Times website; Multitasking is a Lie – Your Brain Needs a Break

For me, the phenomenon of digital distractions is quickly and devastatingly compounded by my reticence towards…well, just about anything that might be work. And I don’t mean my job – I can be a terrifyingly hard worker – but rather anything that requires emotional expenditure or any sort of discipline. I do what I want to do, and I don’t do what I don’t want to do.

Some days (or scandalously longer) this means I’ll avoid cleaning the bathroom.

It also means there’s a 4 month old tomato left abandoned in my refrigerator.

Almost always, though, it means I put off dealing with issues unless given no other choice, typically by an outside force. I will ignore the need for human interaction and sequester myself into self absorbed hermithood. I will deny spiritual malaise and pretend things are ok. I will stifle any emotion for fear I might have to face it head on. I will do anything to distract, amuse, preoccupy, and otherwise block myself from dealing with anything that might require effort. Or honesty. Or a serious look at how I live my life.

In the end it’ll leave me suffocated, underdeveloped, dead. It’s hard to close any more chillingly than with Jonathan Acuff’s article from Wednesday; A Near Life Experience.

I pray God continues to wake me up, albeit slowly it seems, to the ways in which I sabotage my own life! Having just now taken out the trash, it’s a relief to know there’s no longer a tomato dissolving into patchwork moulds in the refrigerator. It’s also a really beautiful day out; a bit cloudy, but an invigorating breeze and fresh clean air. How much am I missing out on right now by stifling and ignoring the emotional baggage that needs to be unpacked, taken care of, sorted through, and dealt with via healthy disciplines?

bookmark  

Trust

iaian7 » blog   John Einselen, 24.09.10    

Wednesday was one of those “off” days. I slept fitfully, woke up late, and work was frustratingly futile. To top it off, Jonathan Acuff’s daily article was pointedly painful. We may know all the right words, say all the right prayers, and talk of God’s grace and forgiveness. Yet if we don’t belong to Him, if we are not wholly surrendered, our complacent and selfish human hearts beat only enough to pump the blood out our gaping wounds, slowly draining us of life like the butcher at a slaughter house. Acuff spoke of the nuclear meltdowns, the rock bottom experiences, the last final gasps where we finally give up, and can then be reborn as we rely fully on God. I’ll refer you to the website instead of continuing to poorly reiterat – A Near Life Experience.

It’s terrifying to look at my life and see so many ways in which I live this way; slowly draining of life, but never fully surrendering or experiencing the fullness of submission to Christ. What a way to make to make an “off” day better. Wait, no, I felt far worse!

What drove my Bible reading that evening was Jon’s mention of Isaiah 30. It all starts off with a diatribe against Israel’s alliance with Egypt, condemning the agreement as unwise, ending only in shame and desolation. “But wait,” I think, “Israel was an occupied country!” They were under the oppressive control of Assyria and desperately wanted out. Time and time again, scripture talks of God’s desire for freedom; freedom from sin, from death, from slavery. Israel was suffering under all of it, and they were yearning for freedom!

Their desire was, I think, spot on.

Their action was not.

Instead of turning to God, or even asking if alignment with Egypt was wise, they made a choice on their own; what must have looked like a promising friendship, a shrewd and timely political alignment.

Now judging from what little I’ve read on the subject, it seems like allying with Egypt could have been recognisable as a bad idea, even without Divine insight. Egypt had been a fickle friend to the Philistines in exactly the same setup just a few years before, and had proven themselves an untrustworthy ally. But Hezekiah apparently didn’t know the underlying political motives, or realise just how easily Judah was getting played. Using neighbouring countries as a buffer between themselves and Assyria, Egypt encouraged rebellion by promising military backing as a way of preventing further incursion by the Assyrians into Egypt’s territory. Of course, once the small nations rose up against their oppressors, providing the perfect distraction for Assyria’s armies, Egypt’s promised military support never materialised, leaving the border countries overpowered and laid to waste. The parallel to our own trusting of worldly strength to combat sin is downright overwhelming as well; betrayal is the only result.

I can’t imagine that God didn’t want freedom for Judah, but that He wanted so badly to be their deliverer Himself. To be the first one they turned to, the only one they trusted, their sole focus. Maybe He would have destroyed Assyria from the inside out, struck them down with plagues, or even used Egypt to turn the tide of the invading armies, but Israel would have had to ask Him first! To trust!

While not as perhaps immediately comforting as I would have liked, I should have recognised the passage; Isaiah 30:18 has been in my list of daily reminders for several weeks now.

Isaiah 30:18 AMP
And therefore the Lord [earnestly] waits [expecting, looking, and longing] to be gracious to you; and therefore He lifts Himself up, that He may have mercy on you and show loving-kindness to you. For the Lord is a God of justice. Blessed (happy, fortunate, to be envied) are all those who [earnestly] wait for Him, who expect and look and long for Him [for His victory, His favor, His love, His peace, His joy, and His matchless, unbroken companionship]!

Mindblowing, isn’t it? I still have no idea how mercy and kindness are a causality of God’s justice, but I’ll try to keep reading through this passage every morning, dwelling daily on the sheer exuberance. The phrase “expect” seems especially potent, repeated both in this verse and in others. Unlike the english word “hope” it cannot be mistaken for vague optimism or well wishes for the future. It’s specific, focused…
and fully trusting.

bookmark  

Gentleness

iaian7 » blog   John Einselen, 21.08.10    

The following is a short article I wrote primarily for myself, but ended up getting published in the Monthly Messenger. Reprinted here by permission of the MM editor, Amy Simonson.

The past several months I’ve been meeting with my pastor each Saturday morning to discuss various issues, questions, and what it means to think rationally as a Christian. One of the more curious personal revelations is that I have no concept of “self” outside of what I do, and more specifically, how well I do it. Not only does this lead to performance-based Christianity (not really Christianity at all!), but it leaves me incapable of understanding how God could love me, even as I fail. Again. And then again.

I rarely exercise as I should, but walking comes naturally enough when I’m mulling over especially troublesome issues. Usually it’s stress from work, but one night was more about my relationship with God. Recent sermons at Church have been about our identity in Christ; I even did artwork for the series, but it’s a concept I really struggle to “see.” After a mile or two on some of the walking paths and streets around my apartment, it’s something I was contemplating heavily again. Who am I? Stripped of everything, why would God care, much less love me?

Well…I create things. As an artist, that’s a rather easy statement to make, but it applies to all of us – in our own ways, we create things, be they sculptures, or words, or music, or hospitality. I know I can remember some of the most insignificant pieces I’ve done, even from 15 years ago, still living clearly in my mind. What if a work of art, one of my creations, were molested, defaced by vandals? What would I feel? Would I treat it with disdain, revulsion, disgust?

Or would I sit there, and cry…

Work sleepless nights to slowly clean, carefully rebuild, gently restore…

Isaiah 40:11
Jeremiah 31:3
Romans 11:6
Ephesians 1:7
Ephesians 2:10

I’ve had to pause several times just writing this, overwhelmed by tears, baffled by God. Gentleness was never something I associated with His character – certainly not His reaction to our fallen nature. But it’s slowly dawning on me that perhaps God wants to heal our broken lives not with brutality, but with care. I write as one not fully grasping yet, sussing out the truth, desperately praying I can be taught these inexpressible whispers from the One who made me.

bookmark  

Kenyan Style Chai

iaian7 » blog » recipes   John Einselen, 13.08.10    

As any short term missionary knows, you’ve got to bring back a recipe. This is mine, updated for those of us that don’t do sugar, and just a hint of vanilla. Enjoy!

read more

Time Vortex

iaian7 » code » quartz   John Einselen, 29.06.10    

An homage to Doctor Who title sequences, this is an interpretation of the Matt Smith style; more cloud-like, than wormhole.

read more

Trailers

iaian7 » blog   John Einselen, 24.06.10    

Seth Rogen has certainly played to a certain typecast, and it was with not-undue-amounts of trepidation that I watched the first trailer for The Green Hornet. Surprisingly enough, this may be his first film I actually watch. Based on what little can be communicated in a trailer, it seems to attempt a fine balance between homage and parody of Batman. It feels too keen to be a true satirization, but too lighthearted for full-out drama. With the mentioning of such genre lampooning, however, Scot Pilgrim vs. the World absolutely must be mentioned. By some of the same people that helped bring us Shaun of the Dead and Hot Fuzz (both deliciously genre-fied films), the Scott Pilgrim trailers promise an over-the-top tribute to classic gaming. Perfectly cornball in an honest and earnest way, I simply cannot wait to see it!

In another example of colours-as-a-name, Red has recently released a trailer as well. How has Helen Mirren not played an elderly hit woman before? Utterly brilliant. Add in Morgan Freeman, Bruce Willis, and others (including Karl Urban of Two Towers fame and Pathfinder infamy), this looks like a riotously fun film.

bookmark  

Anaglyph Compositing

iaian7 » code » quartz   John Einselen, 23.03.10    

Anachrome

How to set up anaglyph compositing in Quartz Composer, with Anachrome, Trioscopic, and ColorCode variations. Includes Core Image Filter source code, and a link for downloading the final Quartz Composer project from the Vectorform blog.

read more