Skip to content

Instantly share code, notes, and snippets.

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
/*
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.
/*
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.
$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++ ; }
// 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
-- 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
@cdmoyer
cdmoyer / gist:236175
Created November 16, 2009 17:58 — forked from padolsey/gist:236004
Successfully add JS code?
var script = document.createElement('script');
var code = "alert('foo');";
try{
script.appendChild(document.createTextNode(code))
} catch(e) {
// IE
script.text = code;
}
@cdmoyer
cdmoyer / add_gist_link_to_dashboard.user.js
Created November 3, 2009 23:42
Add a Gists link to the github dashboard.
@cdmoyer
cdmoyer / tumblr.html
Created October 30, 2009 14:25
How to integrate your tumblog into your site via their jsonp api.
<!-- <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++) {
@cdmoyer
cdmoyer / index.html
Last active September 3, 2015 22:35
My Website
<!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">