This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/python | |
import csv | |
fout = open('ptype_out.csv', 'w') | |
with open('ptype_in.csv', 'rb') as fin: | |
fin_reader = csv.reader(fin, delimiter='|') | |
for row in fin_reader: | |
new_row = ', '.join(row) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cards = ['5555555555554444', '4222222222222', '4111111111111111', '4012888888881881', '378282246310005', '371449635398431', '378734493671000', '6011111111111117'] | |
regex = /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9][0-9])[0-9]{12})|(3[47][0-9]{13}))$/ | |
for (c in cards) { console.log(regex.test(cards[c])) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set guifont=Andale\ Mono:h11 | |
colorscheme Elflord | |
nmap "+gP | |
imap a | |
vmap "+y | |
set guioptions-=T "remove toolbar | |
set guioptions-=r "remove right-hand scroll bar | |
filetype indent on | |
set expandtab | |
set tabstop=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove spaces from filename | |
IFS=$'\n';for f in `find .`; do file=$(echo $f | tr [:blank:] '_'); [ -e $f ] && [ ! -e $file ] && mv "$f" $file;done;unset IFS | |
# resize jpg | |
for i in *.{jpg,JPG}; do echo $i; convert $i -resize 800x600 $i; mogrify -quality 80% $i; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj_ea = new function() { | |
this.url = 'some_ajax_url.php'; | |
this.submit_actions = function() { | |
var data = { | |
'id': 'e04b7291', | |
'email': $('#email1').val(), | |
'status': $('#status1').val(), | |
'email_pre_cust': $('#email4').attr('checked'), | |
'email_pre_fire': $('#email5').attr('checked'), | |
'email_approved': $('#email3').attr('checked'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// apiproxy [atree 12/18/2012] | |
// In order for the cache to work properly, | |
// there needs to be a folder under this script's folder | |
// named temp with the 777 permissions set. | |
// Don't fret if you don't have this, it will just continue on | |
// | |
// this cache will write to here every 12 hours (default) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This command takes LongVide.m4v and extracts 10 minutes of video starting from 21 minutes in. | |
ffmpeg -i LongVideo.m4v -vcodec copy -acodec copy -ss 00:21:00 -t 00:10:00 ShortVideo.m4v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.list = function(req, res) { | |
var return_dataset = []; | |
client.keys('*', function(err, log_list) { | |
var multi = client.multi(); | |
var keys = Object.keys(log_list); | |
var i = 0; | |
keys.forEach(function (l) { | |
client.hget(log_list[l], "modified_at", function(e, o) { |