Skip to content

Instantly share code, notes, and snippets.

@natew
natew / iehosts.rb
Created September 10, 2013 22:02
Copy /etc/hosts and replace with public IP, for quickly setting up the hosts file on a windows VM
#!/usr/bin/ruby
require 'socket'
ip = Socket.ip_address_list.detect { |intf| intf.ipv4? and !intf.ipv4_loopback? }.ip_address
puts "ip: #{ip}"
IO.popen('pbcopy', 'w') do |f|
f << File.read('/etc/hosts').gsub!(/.*127.*localhost/im, '').gsub!(/127\.0\.0\.1/im, ip)
end
@natew
natew / helpers.rb
Created December 30, 2013 22:49
Poltergeist TimeoutError when using within_window
# Helpers module we will use to share common code
# Anything that should be re-used between multiple tests
module Helpers
# last_window will grab the last window opened
# helpful for getting a popup window
def last_window
page.driver.window_handles.last
end
<H3 ADD_DATE="1387212512" LAST_MODIFIED="1389833221">Game</H3>
<DL><p>
<DT><A HREF="http://stormtek.wordpress.com/2013/01/01/creating-an-rts-in-unity-part-i/" ADD_DATE="1387071902">Creating an RTS in Unity: Part I | Elgar&#39;s Code Musings</A>
<DT><A HREF="https://www.youtube.com/watch?v=IZpgMnu_lAk" ADD_DATE="1387071905">Pathfinding challenges with large groups - YouTube</A>
<DT><A HREF="http://en.reddit.com/r/gamedev/comments/1s8qzw/advice_for_2d_rts/" ADD_DATE="1387071908">Advice for 2d RTS? : gamedev</A>
<DT><A HREF="https://github.com/bebraw/jswiki/wiki/Game-Engines" ADD_DATE="1387071963">Game Engines · bebraw/jswiki Wiki</A>
<DT><A HREF="https://github.com/bp74/StageXL/blob/master/lib/stagexl.dart" ADD_DATE="1387073523">StageXL/lib/stagexl.dart at master · bp74/StageXL</A>
<DT><A HREF="http://www.dartgamedevs.org/" ADD_DATE="1387079222">DartGameDevs</A>
<DT><A HREF="https://github
getInitialStateAsync props: { __owner__:
{ props:
{ ref: 'router',
onClick: [Object],
path: '/',
__owner__: [Object],
children: [Object] },
_lifeCycleState: 'MOUNTED',
_pendingProps: null,
_pendingCallbacks: null,
<DT><H3 ADD_DATE="1341364135" LAST_MODIFIED="1394468264">Inspire</H3>
<DL><p>
<DT><H3 ADD_DATE="1369167988" LAST_MODIFIED="1396296873">Blog Inspiration</H3>
<DL><p>
<DT><A HREF="http://blog.studiofellow.com/2013/01/08/stuck-on-your-startups-design/" ADD_DATE="1357854553" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADMklEQVQ4jXWTP0ijdwCGn9/3JQ3+iamJBGN60YuGBGlNoggOBRchhw7tICiuB13FK5QgFQIWcWnB9aCThRIX2620Ip44OFiTeqCJSWOiwtWPGM+QaL5++fLr0uFa2nd74X3e7RH8K6urq0Gr1fqZlHJSCBEBkFKmhRCvDMN4ubKykn13L94ta2trL1RV/TIQCJxEIpEuVVWfApimeZFOp6u5XG7ENM2vlpeXv/nHQSKReM9ms/3Y1dXln52dVfL5/FA2m0XTNAzDoLe3l3A4jN/vzyWTSVmtVgu6rn+SSCT+VAFisdjXLpfrw/n5ed/29rbn9PSUWq2GlBJFUXh4eKBQKGCapmthYaH97OxMNwxjcGdn52exvr7+kRDi1eLi4s3e3l6o2Wxyfn7O0NAQiqIAUK/XKRaLLC0tYbVa0XX9amNjo9M0zY8VKeXzUCiUUhQlFIvFCAaDWCwWAKanp5mZmUEIgcVi4c0fbwDQG40nfzPPFSHEs2g06tjd3QXAZrMhpaRQKFAoFABoa2tDVVV+PToG4PLyimg06pBSPlOklE/7+vqeFotFKpUKHo+Hjo4O
@natew
natew / SassMeister-input.scss
Created April 14, 2014 16:50
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
$ZapposFrontendGlobalAssets: (
"spGlobal.png": "spGlobal.23oi2234.png",
"spGlobalBlue.png": "spGlobalBlue.23oi2234.png",
"stripeBG.png": 'stripeBG.23oi2234.png',
"stripeBGTan.png": 'stripeBGTan.23oi2234.png'
@natew
natew / gist:ff0e1d101fe4c330ec4a
Created October 1, 2014 19:18
instant hacker popups
javascript:jQuery('body').css({overflow:'hidden'});var urls = ["http://38.media.tumblr.com/tumblr_lwz84jsixv1r5qrimo1_500.gif", "http://38.media.tumblr.com/tumblr_m4r4mipGqq1qeumowo1_500.gif", "http://jdandrea.myweb.usf.edu/calabi-spin.gif", "http://media.giphy.com/media/dfq3YU04eBMt2/giphy.gif", "https://31.media.tumblr.com/8cfb9987f141d63d7e6ed31757cef30c/tumblr_n8hfelQaKB1tg7xcdo1_500.gif"];var i = 0;urls.forEach(function(url) { i += 1; console.log(i); (function(ix) { setTimeout(function() { jQuery('<img src='+url+'>').css({ position: 'absolute', zIndex: ix, top: Math.random()*400, right: Math.random()*300, width: '25%', height: 'auto', opacity: 0.8 }).appendTo('body') }, ix * 1000) })(i);});
@natew
natew / gist:d8f7f03cd4b3acdb3c82
Last active August 29, 2015 14:07
immutable-js object tree
var data = Immutable.fromJS({
items: [{
name: "one",
kids: [{
name: "one-one",
kids: [] //...
}]
}]
});
var Component = React.createClass({
render() {
return (
<Layout>
<View title="Deeply Nested">
<div className="content">Example of a deeply nested thing</div>
<View title="Deeply">
<div className="content">This is the first nested drawer</div>