Skip to content

Instantly share code, notes, and snippets.

@ivarvong
ivarvong / gist:2363262
Created April 11, 2012 22:43
ODE MySQL config
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@ivarvong
ivarvong / gist:2395465
Created April 16, 2012 00:08
Berkeley Beacon's CSS
.article_wrap{
width:820px
}
.content_wrap{
margin:0 auto
}
.content_wrap h1{
font:25px/28px "Arvo",Rockwell,serif;margin-bottom:5px
@ivarvong
ivarvong / gist:2416954
Created April 18, 2012 22:07
bytes.dailyemerald.com nginx config
server {
listen 80;
server_name bytes.dailyemerald.com;
root /home/dailyemerald/web/bytes.dailyemerald.com;
index index.html index.php;
client_max_body_size 50M;
client_body_buffer_size 128k;
access_log /var/log/nginx/bytes.dailyemerald.access.log;
@ivarvong
ivarvong / gist:2417459
Created April 19, 2012 00:02
jsdom and nodejs mini scraper
var request = require('request');
function toTitleCase(str) {
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
request('http://housing.uoregon.edu/dining/todaysmenu.php?d=1335078000&lid=1', function (error, response, body) {
if (!error && response.statusCode == 200) {
var window = require('jsdom').jsdom(body, null, {
var content = {
created: new Date();
id: '234'
slug: 'my news story',
story: {
created: new Date(),
headline: 'my story headline',
reporter: 'first last', //userID
summary: 'this is an important story about something!',
length: 18
58 mkdir overview
59 cd overview/
60 ls
61 git clone https://github.com/overview/overview-prototype.git
62 cd overview-prototype/
63 time ../overview-prototype/preprocess.sh iraq-contractor-incidents
64 ruby -v
65 sudo gem install fastercsv
66 time ../overview-prototype/preprocess.sh iraq-contractor-incidents
67 cd ..
@ivarvong
ivarvong / gist:2766639
Created May 22, 2012 04:42
jsdom website test
var request = require('request')
, fs = require('fs');
var atLeastOne = ['a', 'img', '#bottom-left-well', '#primary', '#footer', '#center-well img']
var isUp = true;
setTimeout(function() {
if (isUp) {
console.log("We're good.");
EEEEEEEEEEEEEEEEEEEEEEEEEEEE
E::::::::::::::::::::::::::E
E::::::::::::::::::::::::::E
E::::::EEEEEEEEEEEEEEEEEEEEE
E::::::E
E::::::E
E::::::E EEEEEEEEEEEE
E::::::E E::::::::::E
E::::::E E::::::::::E
E::::::E EEEEEEEEEEEE
@ivarvong
ivarvong / gist:2893838
Created June 8, 2012 05:49
nginx config for pushState with Backbone.js
server {
listen 80;
server_name trials.dailyemerald.com;
access_log /srv/www/trials.dailyemerald.com/access.log;
gzip on;
location / {
root /srv/www/trials.dailyemerald.com/public_html;
try_files $uri /index.html;
}
@ivarvong
ivarvong / template-trials.php
Created June 18, 2012 21:41
A WordPress template for the Emerald's homepage for the 2012 Olympic Trials
<?php
/*
Template Name: Olympic Trials (template, Ivar)
*/
get_header();
/* http://www.wprecipes.com/wordpress-shortcode-display-the-loop */
function sc_query($atts, $content = null) {
extract(shortcode_atts(array(
"query" => '',