Skip to content

Instantly share code, notes, and snippets.

View scrubmx's full-sized avatar
🏴‍☠️

Jorge González scrubmx

🏴‍☠️
View GitHub Profile
  • 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
@scrubmx
scrubmx / s3
Created June 13, 2016 15:13 — forked from adamwiggins/s3
#!/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'],
@scrubmx
scrubmx / selenium-screenshotting.md
Created March 21, 2016 06:36 — forked from dannguyen/selenium-screenshotting.md
Using Selenium and Python to screenshot a javascript-heavy page

Using Selenium and Python to screenshot a javascript-heavy page

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

@scrubmx
scrubmx / cornify.js
Created March 10, 2016 22:09 — forked from scottstanfield/cornify.js
cornify.js: konami code with rainbows and unicorns
// 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(){
@scrubmx
scrubmx / syntax.js
Last active August 29, 2015 14:23 — forked from thomasboyt/syntax.js
// 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.
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){