Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@victusfate
victusfate / README.md
Created December 20, 2012 09:20 — forked from dlo/README.md

A lot of the time, crash reports sent via email get a bit garbled over the wire, and Xcode won't symbolicate them. It turns out that a lot of email clients (including Apple Mail) are the cause of this.

This script takes a crash report and cleans it up so that Xcode likes it.

Usage:

$ cat example.crash | cleanup.py
@victusfate
victusfate / grunt-yslow.js
Created November 24, 2012 09:40 — forked from ahomu/grunt-yslow.js
WIP: HARを取得して、Yslowで評価するぞくん
module.exports = function(grunt) {
'use strict';
var TEMP_HAR_RESOURCE = '.har.tmp';
var exec = require('child_process').exec,
YSLOW = require('yslow').YSLOW,
doc = require('jsdom').jsdom(),
util = grunt.utils || grunt.util,
@victusfate
victusfate / gist:4117890
Created November 20, 2012 13:18 — forked from dav/gist:3738695
Script to copy photos/videos into iPhone Simulator
require 'etc'
require 'fileutils'
# Copies the most recent MAX_IMAGES photos/videos from the device image dir.
# I use Dropbox to sync my device images to my workstation disk
MAX_IMAGES=500
USER_HOME_DIR = Etc::getpwuid.dir
DEVICE_IMAGES_DIR="#{USER_HOME_DIR}/Dropbox/Camera Uploads"
SIMULATOR_IMAGES_DIR="#{USER_HOME_DIR}/Library/Application Support/iPhone Simulator/5.1/Media/DCIM/100APPLE"
@victusfate
victusfate / gist:4066924
Created November 13, 2012 16:50 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@victusfate
victusfate / generate.sh
Created November 3, 2012 09:44
sign and verify
#!/bin/bash
ssh-keygen -f $1 -b 1022 -q
ssh-keygen -e -f $1.pub -m PEM > $1.pem
@victusfate
victusfate / mp3.cpp
Created November 2, 2012 10:33 — forked from gurgeh/mp3.cpp
A C++ example of Dive Into Python
//Having to include so many different header files to do basic
//things like open a file, use strings, vectors and tuples, etc,
//is still annoying.
#include <fstream>
#include <vector>
#include <map>
#include <tuple>
#include <string>
//To use C++11 lambdas with Boost lambdas we define this.
@victusfate
victusfate / make_touch_this.js
Created September 4, 2012 10:15
mc hammer javascript cross-compiler
#!/usr/bin/env node
// mc hammer javascript cross-compiler
// 1. youtube-dl http://www.youtube.com/watch?v=otCpCn0l4Wo -o cant_touch_this.flv
// 2. avconf -o cant_touch_this.flv cant_touch_this.wav
// 3. sox cant_touch_this.wav -t s16 -r 8k -o cant_touch_this.raw
// 4. run this file (node make_touch_this.js)
// 5. npm install -g baudio-party
// 6. baudio-party &
// 7. curl -sSNT cant_touch_this.js http://localhost:5000/0
@victusfate
victusfate / easy_way.rb
Created September 2, 2012 14:21 — forked from mislav/easy_way.rb
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
###
# Scheme code is translated to YARV byte code, then evaluated in the
# Ruby Virtual Machine
require 'rbconfig'
require 'dl'
require 'fiddle'
require 'strscan'
class RubyVM