Skip to content

Instantly share code, notes, and snippets.

@nhunzaker
nhunzaker / viewport.js
Created Oct 23, 2012
Viewports in Phantom.js
View viewport.js
// Viewport
//
// phantom.js viewport.js http://google.com 400
var args = require("system").args;
var url = args[1];
var width = args[2];
var height = args[3];
@firedfox
firedfox / onDOMContentLoaded.js
Created Apr 24, 2012
phantomjs onDOMContentLoaded
View onDOMContentLoaded.js
const PHANTOM_FUNCTION_PREFIX = '/* PHANTOM_FUNCTION */';
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
if (msg.indexOf(PHANTOM_FUNCTION_PREFIX) === 0) {
eval('(' + msg + ')()');
} else {
console.log(msg);
}
@diversen
diversen / phar-composer-usage-example.md
Last active Dec 31, 2016
notes about phar-composer
View phar-composer-usage-example.md

phar-composer example

Create a composer dir called pgit

Create a composer.json file inside this dir containing:

{
    "require": {
        "diversen/minimal-cli-framework": "^1.1"
@olizilla
olizilla / traffic-light-disco.js
Created Jul 22, 2013
A johnny-five, event based, traffic light disco for your Arduino. An array of lights flash in majestic sequence for your gyratory pleasure. Each light's shining heralds it's own destruction, each extinction seeds a new. Just like the traffic light eyeball cannons of your friendly neighbourhood mobile DJ
View traffic-light-disco.js
/*
======================================================================================================================================
= ==================== ===== =================== =================== ================ ===========================
==== ====================== == === == ================== =================== ================ ==== ==========================
==== ====================== ======= ====================== =================== ====== ======== ==== ==========================
==== ===== = ==== === ===== ===== === ======== ======== === === ===== ======= ==== == === ==== ==== ==
==== ===== = == = === ======= ========== = ======= ============ = == ==== ======== ==== ====== = == = == =
==== ===== ========== === ======= ====== == ========== ======== === == = === ======== ==== == === ==== ===== = =
==== ===== ======== === ======= ====== == ========== ======== ==
@soska
soska / index.html
Created Dec 29, 2016 — forked from anonymous/index.html
Musical Chord Progression Arpeggiator
View index.html
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
anonymous
anonymous / index.html
Created Dec 29, 2016
Musical Chord Progression Arpeggiator
View index.html
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
@bosmacs
bosmacs / latex.template
Created Jun 28, 2011 — forked from michaelt/latex.template
Simple Pandoc latex.template with comments
View latex.template
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@rajeevkannav
rajeevkannav / pdf2htmlEX.sh
Last active Apr 11, 2020
Install CMake, pkg-config,GNU Getopt,GCC,poppler,fontforge,pdf2htmlEX in Ubuntu 15.05
View pdf2htmlEX.sh
#!/bin/bash
# Ubuntu Developer Script For pdf2htmlEx
# Created by Rajeev Kannav Sharma
# http://rajeevkannav.github.io/
#
#
# Downloads and configures the following:
#
# CMake, pkg-config
# GNU Getopt
@cburgdorf
cburgdorf / xor_keras.py
Last active Nov 18, 2020
Comparing XOR between tensorflow and keras
View xor_keras.py
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
target_data = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(32, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
@searbe
searbe / parse_xlsx.php
Created Aug 7, 2012
Parse simple XLSX in PHP with SimpleXML and ZipArchive
View parse_xlsx.php
<?php
/**
* I had to parse an XLSX spreadsheet (which should damn well have been a CSV!)
* but the usual tools were hitting the memory limit pretty quick. I found that
* manually parsing the XML worked pretty well. Note that this, most likely,
* won't work if cells contain anything more than text or a number (so formulas,
* graphs, etc ..., I don't know what'd happen).
*/