Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
// John Cage's 4'33" with the Web Audio API | |
function makeSilence(e) { | |
var buflen = e.outputBuffer.length; | |
var dataL = e.outputBuffer.getChannelData(0); | |
var dataR = e.outputBuffer.getChannelData(1); | |
dataL.fill(0); | |
dataR.fill(0); | |
} | |
function InitAudio() { |
{ | |
"origin": [ | |
"<svg width=\"400\" height=\"200\">#pattern#</svg>" | |
], | |
"circlecolor": [ | |
"pink", | |
"cyan", | |
"yellow", | |
"orange", | |
"gray", |
This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!
A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:
.
// First, create a reference to the Wikifier.createInternalLink function. | |
// (Internally, this is what Twine uses to connect passages together. | |
// It is the last step in parsing double-bracked content into links.) | |
var oldCreateInternalLink = Wikifier.createInternalLink; | |
// Then, create a new function that mimics its functionality. | |
Wikifier.createInternalLink = function(place, title) { | |
// By calling the old function, it returns | |
// the DOM element (the link) it was about to |
This Twine macro lets you make the screen shake! Tested in Chrome and Firefox. Should work in Opera and IE 10+. Uses CSS3 animations, taken from this CSS Reset tutorial.
IMPORTANT NOTE: Due to a bug in Twine 1.3.5, macros do not work on the Start passage. If you want to use this code (or any other macro) on your starting passage, you should put your start passage in a new passage called "ActualStart" and then put the following code in the Start passage:
<<display ActualStart>>
This Twine macro lets you use the Wordnik API to get random nouns and adjectives for your story.
Modifies the Jonah theme so that it can be used as a presentation (like if you want to display it on a projector). In addition to making the text bigger and playing with the content width, this also maps the left arrow key to move backwards in your presentation. (Forward arrow doesn't make sense because you might have a branching presentation.)
By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.
Could be modified to be more advanced (match regular expressions to answer questions, etc.)
Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa
Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1