Skip to content

Instantly share code, notes, and snippets.

View evadne's full-sized avatar
🎣
gone fishing

Evadne Wu evadne

🎣
gone fishing
View GitHub Profile
@evadne
evadne / plNews.js
Created March 13, 2010 12:08
Punchy Live’s twitter interactivity engine that is going to be polished and extended into monoTwitterEngine
// plNews.js
/*
Delegate methods:
plNewsDidReceiveNewerTweets to delegate object
plNewsDidReceiveOlderTweets to delegate object
*/
<!-- STUDIO -->
<symbol id="Pragma marks" font-weight="normal" font-style="normal" image="SymbolMark" indentation="0" ignoreblocks="no" show-in-comments="yes">
<regex>/\*[\s\t]+!(.+) \*/</regex>
</symbol>
<symbol id="Pragma marks" font-weight="normal" font-style="normal" image="SymbolMark" indentation="0" ignoreblocks="no" show-in-comments="yes">
<regex>//[\s\t]+!([^\n\r]+)</regex>
</symbol>
// var%20jQueryScriptTag%20=%20document.createElement(%27script%27);jQueryScriptTag.setAttribute(%27src%27,%20%27http://jquery.com/src/jquery-latest.js%27);document.getElementsByTagName(%27body%27)[0].appendChild(jQueryScriptTag);jQueryScriptTag.onload%20=%20function(){jQuery.noConflict();var%20eradicate%20=%20[%27%E6%97%A9%E5%AE%89%27,%20%27%E5%8D%88%E5%AE%89%27,%20%27%E6%99%9A%E5%AE%89%27];jQuery(%27.plurk_cnt%27).each(function(key,%20object){var%20plurkObject%20=%20jQuery(object);var%20plurkObjectContainsText%20=%20String(plurkObject.text());for%20(keyEradication%20in%20eradicate)if(plurkObjectContainsText.match(eradicate[keyEradication])%20!=%20null)plurkObject.closest(%22.plurk%22).fadeOut(400).remove();});}
var jQueryScriptTag = document.createElement('script');
jQueryScriptTag.setAttribute('src', 'http://jquery.com/src/jquery-latest.js');
document.getElementsByTagName('body')[0].appendChild(jQueryScriptTag);
jQueryScriptTag.onload = function(){
jQuery.noConflict();
var eradicate = ['早安', '午安', '晚安
// ==UserScript==
// @name GooView
// @namespace Google
// @description Opens files of various formats using Google Viewer.
// ==/UserScript==
for (link in document.links)
if (/ppt|png|pdf|tif|tiff|javascript|file\:/ig.exec(link.href) != null)
link.href = 'http://docs.google.com/viewer?url=' + link.href;
@evadne
evadne / Barker.js
Created April 26, 2010 15:01
Barker.js — works with Safari only for now
// barker.js
// Evadne Wu at Iridia, 2010
// One-liner (bookmarklet):
// javascript:eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0 2=/[\\8-\\9]/b;0 1=((c(){0 a=d("e a f g?","汪");3(a==h||a=="")4 i;4 a})());3(1)5.6.7=5.6.7.j(2,1);',20,20,'var|substitutionGlyph|chineseRegexRange|if|return|document|body|innerHTML|u4E00|u9FFF||ig|function|prompt|Enter|candidate|glyph|null|undefined|replace'.split('|'),0,{}));
@evadne
evadne / termHere_Xcode.sh
Created July 5, 2010 08:19
Custom user script that opens a new Terminal window where the current file lives.
#!/bin/sh
/usr/bin/osascript <<-EOF
tell application "Terminal"
activate
do script "cd `dirname %%%{PBXFilePath}%%%`"
end tell
/Works/Code/isaacs-npm (master) $ sudo make dev
Password:
./cli.js install .
npm it worked if it ends with ok
npm cli [ 'install', '.' ]
npm version 0.1.23
npm config file /Volumes/Data/.npmrc
npm config file /usr/local/etc/npmrc
npm install pkg .
We add and update new sites to our index each time we crawl the web, and we invite you to submit your URL here. We do not add all submitted URLs to our ...
evadne@Museo ~/Works/Code/monoceroi-cappuccino (master) $ sudo ./bootstrap.sh
================================================================================
Found an existing Narwhal/Cappuccino installation, /usr/local/narwhal. Remove it automatically now?
WARNING: the ENTIRE directory, /usr/local/narwhal, will be removed (i.e. 'rm -rf /usr/local/narwhal').
Be sure this is correct. Custom modifications and installed packages WILL BE DELETED.
Enter "yes" or "no":
yes
================================================================================
Narwhal JavaScript platform is required. Install it automatically now?
Enter "yes" or "no":
<?php
function arGenerateExcerpt ($incomingText = "", $maximumAllowedLength = 75, $wrapperElementTagName = "p") {
$responseText = "";
$contentInParagraphs = explode("</" . $wrapperElementTagName . ">", $incomingText);
foreach ($contentInParagraphs as $paragraph) {