Skip to content

Instantly share code, notes, and snippets.

View program247365's full-sized avatar
💭
YOLO 💯

Kevin Ridgway program247365

💭
YOLO 💯
View GitHub Profile
@minipai
minipai / express-renderReact.js
Created February 13, 2015 02:36
Express middleware to render react.js on server side, with react-router
var React = require('react');
var Router = require('react-router');
var DocumentTitle = require('react-document-title');
var reactRoutes = require('../view/_route.jsx');
var Html = require('../view/Html.jsx');
/**
* @name RenderView
* @constructor
@developit
developit / set-immediate.js
Last active August 29, 2015 14:23
setImmediate multiple implementations
var setImmediate = (function(f, q, p, reg) {
q = [];
f = document.createElement('iframe');
f.style.cssText = 'position:absolute;top:-999em;left:0;width:1px;height:1px;';
document.body.appendChild(f);
function done() {
for (var i=0; i<q.length; i++) q[i]();
q.length = 0;
}
p = [
@developit
developit / es-component.js
Created June 17, 2015 20:01
React ES6 Components
import React from 'react';
export class Component extends React.Component {
constructor(...args) {
super(...args);
this.generateBindings();
if (typeof this.init==='function') {
this.init();
}
}
/**
* var jpr = new JSONPRequest();
* jpr.onload = (...data) => {
* console.log(data);
* };
* jpr.open('GET', 'some-url?callback={{callback}}');
* jpr.send();
*/
#!/usr/bin/env ruby
# Pow Port
#
# Quickly and easily change the port that Pow is running on. This allows
# you too run Apache and Pow side-by-side (on different ports of course).
#
# WARNING: This will OVERWRITE your ~/.powconfig file. If you have custom
# configurations in there, please back it up first.
#
@program247365
program247365 / httpd.conf
Created September 17, 2011 11:25
Improved Shaun Inman's excellent script for allowing a PHP file to generate a HTML file so that Quicksilver can index it. Originally his script (specifically the regex) didn't work for me.
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@elazar
elazar / PasswordIterator.php
Created November 6, 2011 04:55
Iterator to generate sequential passwords within a given length range
<?php
/**
* Iterator to generate sequential passwords within a given length range.
*/
class PasswordIterator implements Iterator
{
/**
* Length of the next password to be generated
* @var int
*/
@oslego
oslego / index.html
Created May 28, 2012 15:12
QUnit and Browserscope boilerplate code.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="qunit/jquery.js"></script>
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript">
// To save data in Browserscope do something like the following.
// The syntax is 'test_key': 'value' where test_key is some unique
@averyvery
averyvery / Gemfile
Created July 5, 2012 16:14
Gemfile
source 'http://rubygems.org'
# Compiling
gem 'compass'
gem 'compass-growl'
# Guard
gem 'guard'
gem 'guard-compass'
gem 'guard-livereload'
gem 'guard-process'
@netologist
netologist / MountainLion-Python-Fix
Created July 27, 2012 05:44 — forked from sonicradish/MountainLion-Python-Fix
Fix Mountain Lion 10.8 Python IOError pyconfig.h Error
After upgrading to Mountain Lion : 10.8 I noticed that I was getting Python errors which prevented me from starting vim:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars