This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl 'http://2014.xoxofest.com/assets/php/attendees_json.php?var=attendees_json' | sed 's/.* = //' | sed 's/;$//' | json_pp | grep 'twitter_username' | sed 's/.*: "\([^"]*\)".*/\1/' > xoxo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2008, Adobe Systems Incorporated | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are | |
met: | |
* Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (c) 2008, Adobe Systems Incorporated | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are | |
met: | |
* Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$chance = 30; | |
$total = 0; | |
$times = 0; | |
for ($i=0; $i<500000; $i++) { | |
$seen = 0; | |
for ($t = 0; $t<15; $t++) { | |
$roll = int(rand(100) + 1); | |
if ($roll < $chance) { $seen++; } | |
elsif (($t == 4 && $seen == 0) || ($t == 9 && $seen == 1) || ($t == 14 && $seen == 2)) { $seen++ ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Show Subcontext on scripting.com, highlight | |
// Copyright (c) 2010, Chris Moyer (chris@inarow.net) http://inarow.net/ | |
// MIT (http://www.opensource.org/licenses/mit-license.php) licensed. | |
// | |
// | |
// ==UserScript== | |
// @name Scripting.com Subcontext Opener | |
// @namespace http://inarow.net/ | |
// @include http://scripting.com/* | |
// @description Version 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lack of easy access to anything better than second resolution. Blah. | |
math.randomseed(os.time()) | |
-- Successive seeds of os.time() that are close end up creating the same | |
-- value on OSX due to the integer making or random(x,y) losing precision | |
math.randomseed(os.time() * math.random()) | |
local num = math.random(1e7,1e8) | |
while num ~= 1 do | |
str = "" .. num | |
if num % 2 == 0 then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = document.createElement('script'); | |
var code = "alert('foo');"; | |
try{ | |
script.appendChild(document.createTextNode(code)) | |
} catch(e) { | |
// IE | |
script.text = code; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// github gist linker | |
// Copyright (c) 2009, Chris Moyer (chris@inarow.net) http://inarow.net/ | |
// MIT (http://www.opensource.org/licenses/mit-license.php) licensed. | |
// | |
// | |
// ==UserScript== | |
// @name github gist linker | |
// @namespace http://inarow.net/ | |
// @include http://github.com/* | |
// @description Version 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- <head> if jquery isn't on the page already --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
<!-- <head>, another file, wherever --> | |
<script type="text/javascript"> | |
function tumblr(resp) { | |
var posts = resp.posts; | |
$('#blog .loading').replaceWith('<ul/>'); | |
$ul = $('#blog ul'); | |
for (var i=0; i<posts.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Chris Moyer (Let's get our ducks in a row.)</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<meta name="description" content="Chris Moyer (CDMoyer) - Freelance Developer (PHP, Javascript, Perl, Ruby) in Buffalo, NY"> | |
<style type="text/css"> |
NewerOlder