- Dynamic Dispatch
- Dynamic Method
- Ghost Methods
- Dynamic Proxies
- Blank Slate
- Kernel Method
- Flattening the Scope (aka Nested Lexical Scopes)
- Context Probe
- Class Eval (not really a 'spell' more just a demonstration of its usage)
- Class Macros
🏴☠️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'aws/s3' | |
class S3Cmd | |
include AWS::S3 | |
def initialize | |
Base.establish_connection!( | |
:access_key_id => ENV['AWS_ACCESS_KEY_ID'], |
As websites become more JavaScript heavy, it's harder to automate things like screenshotting for archival purposes. I've seen examples and suggestions to use PhantomJS for visual testing/archiving of websites, but have run into issues such as the non-rendering of webfonts. I've never tried out Selenium until today...and while I'm not thinking about performance implications yet, Selenium seems far more accurate than PhantomJS...which makes sense since it actually opens a real browser. And it's not too hard to script to do complex interactions: here's an [example of how to log in to Twitter, write a tweet, upload an image, and send a tweet via Selenium and DOM element selection](https://gist.github.com/dannguyen/8a6fa49253c1d6a0eb92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified to 'a a' instead of 'b a' due to vimium conflict | |
// ▲ ▲ ▼ ▼ ◀ ▶ ◀ ▶ a a | |
// example page: http://yckart.github.io/jquery.konami.js/ | |
// | |
var kkeys = [], konami = "38,38,40,40,37,39,37,39,65,65"; | |
$(document).keydown(function(e) { | |
kkeys.push( e.keyCode ); | |
if ( kkeys.toString().indexOf( konami ) >= 0 ){ | |
$(document).unbind('keydown',arguments.callee); | |
$.getScript('http://www.cornify.com/js/cornify.js',function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ES6 includes a new block keyword, "module", for defining modules | |
// in-line. | |
module "myModule" { | |
export default function() { | |
// You can export classes, functions, and other blocks. | |
return "Hello :)"; | |
} | |
// You can mix a default and named exports. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('browserify', function() { | |
return browserify('./js/app.js') | |
.transform(babelify, { stage: 0 }) | |
.bundle() | |
.on('error', function(e){ |