Skip to content

Instantly share code, notes, and snippets.

View gleuch's full-sized avatar
🏃‍♂️
Marathon

Greg Leuch gleuch

🏃‍♂️
Marathon
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<category>
<pattern>GOODBYE <set name="clientName">*</set></pattern>
<template>
Goodbye <get name="clientName" />.
</template>
</category>
<category>
<pattern>HELLO <set name="clientName">*</set></pattern>
@gleuch
gleuch / gist:7721755
Created November 30, 2013 17:18
sample for random image replacement on page
// Really basic shuffle function for array, via http://stackoverflow.com/a/6274381
function shuffle(o){for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o;};
// Your replacement images
var replaceImages = array('image1.jpg', 'image2.jpg'); // add more here
var replaceIndex = 0; // stores which image in your array you are on
// Randomize the array so it is not always the same each time
replaceImages = shuffle(replaceImages);
# 30 mar 2012
final = {:draw => [46, 23, 38, 4, 2], :mega => 23}
scores = [
{:draw => [0,0,0,0,0], :mega => 0},
{:draw => [0,0,0,0,0], :mega => 0},
{:draw => [0,0,0,0,0], :mega => 0},
{:draw => [0,0,0,0,0], :mega => 0},
@gleuch
gleuch / gist:862497
Created March 9, 2011 16:35
Open Chrome with iPhone 4 User Agent
open /Applications/Google\ Chrome.app/ --args -user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"
#!/bin/sh
#
# branch [branchname]
#
# Create a new local AND remote git branch
# Setup local branch to use remote tracking
#
branch=$1
if [ -z $branch ]; then
@gleuch
gleuch / gist:649975
Created October 27, 2010 20:58 — forked from ashgti/gist:649948

1. How difficult is it for you to find specific images on the internet for your projects?
Sometimes difficult, but with meme research, I’ve got a list of sites I haunt.

2. Would it be helpful for you to see how other users have rated images you are considering?
Yes. Virality is also important, such as # views, where it has been used, etc.

3. How important is it for you to be able to find high-resolution images?
Yes.

4. Would you be willing to share your own images for free or for a fee?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>
hi
</title>
<script language="JavaScript" type="text/javascript">
<!--
function Add(href) {
WebRing[++NumInWebRing] = new WebRingObject(href);
*Magma Open to the Public*
Today marks a big day for Magma — our website is now officially open to everyone.
We owe a large thanks to the nearly five thousand beta users. Their wonderful suggestions and feedback were invaluable during our three month beta period. During that time, we have collected over 65,000 videos, millions of rows of video statistics, and ------.
Of course, a big thanks also goes out to our wonderful team: Andrew Baron, Jamie Wilkinson, Kenyatta Cheese, Greg Leuch, and Todd Persen.
*Must Watch*
Magma was created for you to explore, discover, collect, share, and track videos from all over the internet.
Every video on Magma is given a score of 1 - 11. This score is an indication of how
popular the video has become, determined by the amount of social buzz, distrubution,
and view counts.
The Magma homepage is an aggregation of various channels and group that display what
is upcoming and popular across the web. The Must Watch area is a collection of upcoming
// Sniff out visited links by a user with jQuery
// by Greg Leuch <http://www.gleuch.com>
// based on an initial idea from Jonathan Snook <http://snook.ca>
// idea: <http://twitter.com/snookca/status/1121377463>
// Note: Only works if user has browser history enabled (save history for x >0 days)
// Edit: looks like my code mimics same idea that Aza Raskin's SocialHistory.js does, sans iframe and visit color matching. <http://www.azarask.in/blog/post/socialhistoryjs/>