Skip to content

Instantly share code, notes, and snippets.

View HomerJSimpson's full-sized avatar

Homer Simpson HomerJSimpson

  • New Jersey, USA
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
@HomerJSimpson
HomerJSimpson / script.js
Created November 5, 2015 23:49
iterating over list of links with casperjs
casper.then(function() {
href = this.evaluate(function() {
return document.querySelectorAll('a[href*="manageForms"]')[0].href;
});
casper.thenOpen(href, function() {
var iFormsLinks = this.evaluate(function() {
return Array.prototype.slice.call(document.querySelectorAll('td:last-child a:first-child')).map(function(e) {
return e.href;
});
@HomerJSimpson
HomerJSimpson / playground.swift
Created October 19, 2015 21:25
POST application/x-www-form-urlencoded via swift
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely(true)
extension NSMutableURLRequest {
/// Percent escape
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML 5 complete</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer, header,
computeSourcePath=true
contextsDir=d\:\\platform\\root\\test0001\\conf\\catalina\\localhost
eclipse.preferences.version=1
jvmParameters=-XX%3AMaxMetaspaceSize%3D256m;-XX%3AReservedCodeCacheSize%3D320m;-Xms1024m+-Xmx2024m;-Dcom.sun.management.jmxremote.port%3D30001;-Dcom.sun.management.jmxremote.authenticate%3Dfalse;-Dcom.sun.management.jmxremote.ssl%3Dfalse;-Dfile.encoding%3DUTF-8;-javaagent%3AD%3A%5Ccommon%5Cjrebel6%5Cjrebel.jar;
managerUrl=http\://localhost\:8080/manager
projectsInSourcePath=Integration;Provider;RestUtility;Web;
tomcatBase=d\:\\platform\\root\\test0001
tomcatConfigFile=d\:\\common\\tomcat7\\conf\\server.xml
tomcatDir=d\:\\common\\tomcat7
tomcatJRE=1428690496570
@HomerJSimpson
HomerJSimpson / test.js
Last active August 29, 2015 14:20
walk iframes
var myFrames = [];
function mkLog(name) {
return function() {
console.log('unloading ' + name);
};
}
(function walk(d) {
var doc = d.contentDocument || d, i, iframes = doc.getElementsByTagName('iframe');
console.log('found ' + iframes.length + ' iframes');
myFrames.push({ doc :doc, frame : d.contentDocument, node : d, id : d.id, name:d.name });
@HomerJSimpson
HomerJSimpson / .html5.html
Created April 21, 2015 21:02
Bootstrap 3.3.4 empty template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
@HomerJSimpson
HomerJSimpson / gist:b5b83977ad5b667baf75
Created January 6, 2015 18:03
Scrape envato author page for sales and revenue
/*jslint white:true, unparam:true, browser:true */
/*global $, casper, console, jQuery */
(function() {
"use strict";
var casper = require('casper').create();
console.log("Starting...");
casper.start('http://themeforest.net/user/oxygenna/portfolio?direction=desc&order_by=sortable_at&view=grid', function() {
console.log('scraping');
var rv = this.evaluate(function() {
@HomerJSimpson
HomerJSimpson / readme.markdown
Last active August 29, 2015 14:12
Convert avi to mp4 copying video and re-encoding the audio as aac

Convert avi to mp4 copying video and re-encoding the audio as aac

        ffmpeg \
                -fflags +genpts `# http://superuser.com/a/710087` \
                -i Hawaii.Five-0.2010.S01E01.avi \
                -vcodec copy `# copy the video` \
                -acodec aac -strict -2 `# re-encode the audio as aac` \
                Hawaii.Five-0.2010.S01E01.mp4
@HomerJSimpson
HomerJSimpson / .gitignore
Last active August 29, 2015 14:11
NSDate experiment
main
*.o