Skip to content

Instantly share code, notes, and snippets.

View Demeter's full-sized avatar

demeter Demeter

  • 01:23 (UTC -07:00)
View GitHub Profile
@Demeter
Demeter / data.yml
Created October 14, 2011 18:20
Populate the database
# 5000 users for populating database.
# names taken from http://www.census.gov/genealogy/names/names_files.html
#
# def user_data
# $user_data ||= YAML.load_file('data.yml').collect{|permalink, u| u }
# $user_data[rand($user_data.size)]
# end
eduardo-yuhas:
:email: eduardo.yuhas@example.com
@Demeter
Demeter / anywhere.html
Created October 14, 2011 18:40 — forked from code/anywhere.html
twitterhtml4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>index</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="mustache.js"></script>
<script type="text/javascript" src="app.js"></script>
@Demeter
Demeter / gist:1287954
Created October 14, 2011 18:49 — forked from alexedwards/gist:445157
another password phraser
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple Password - Returns a simple pronouncable passphrase.
Examples: Motir27, Wesag97, Muvak41
Rated as 'good' by http://www.passwordmeter.com/
@access public
@return string
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function simple_password() {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }
@Demeter
Demeter / Oink questions on StackOverflow
Created October 14, 2011 18:13 — forked from iconara/Redis questions on StackOverflow
How to query StackOverflow for the most recent, unanswered but upvoted, questions tagged "oink"
#!/usr/bin/env ruby
require 'zlib'
require 'open-uri'
require 'json'
io = Zlib::GzipReader.new(open("http://api.stackoverflow.com/1.0/questions?tagged=oink&sort=votes&min=1"))
obj = JSON.parse(io.read)
@Demeter
Demeter / password_generator.rb
Created October 14, 2011 18:18 — forked from code/password_generator.rb
Password generator
# File: password_generator.rb
# Author: Luke Hubbard
# Gist: http://gist.github.com/21812
# License: MIT
require 'digest'
class PasswordGenerator
CHARS = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0)
SIZE = 9
@Demeter
Demeter / gist:1288430
Created October 14, 2011 21:38 — forked from brianblakely/gist:581868
Header tags of meta wisdom
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@Demeter
Demeter / gfm.rb
Created October 14, 2011 22:03 — forked from mojombo/gfm.rb
Gem of Github Flavored Markdown
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
@Demeter
Demeter / comments.xml
Created October 14, 2011 22:07 — forked from mojombo/comments.xml
Less Horrible XML Comments
<container>
<thing />
<!--
I think this is the least horrible way to format XML comment
blocks. Even though it wastes two lines, at least it doesn't
involve tons of indenting or horribly misaligned edges.
-->
<fooblah size="10" count="alot" />
</container>
@Demeter
Demeter / ben.py
Created January 10, 2012 08:37 — forked from fweez/ben.py
Benfords law bins for within directory file sizes
#!/usr/bin/env python
import os
import subprocess
# First, build up the results file. it'll have the form:
# 110 vidioc-g-dv-preset.xml
linecount_cmd = "rm results; for i in *; do find $i -execdir wc -c '{}' \; " + \
">> results; done;"
os.system(linecount_cmd)