Skip to content

Instantly share code, notes, and snippets.

View tansaku's full-sized avatar

Sam Joseph tansaku

View GitHub Profile
@tansaku
tansaku / AverageNumberWordsInTweets
Created October 17, 2012 16:03
Get average numbers of words in your tweets
# uses http://code.google.com/p/python-twitter/
username = 'tansaku' # insert your username here
import twitter
api = twitter.Api(username,count=1000)
statuses = api.GetUserTimeline()
sum([len(s.text.split()) for s in statuses])/len(statuses)
@tansaku
tansaku / gist:3959433
Created October 26, 2012 15:28
Google App Script Form Processing
function processForm(params) {
var ss = SpreadsheetApp.openById(csc3211fall2012_ss);
var email_sheet = ss.getSheetByName('Week '+(parseInt(params['week'],10)+1)+' Assignments');
var range = colName(parseInt(params['assignment'],10)+1) + (parseInt(params['match'],10)+1);
var existing_val = email_sheet.getRange(range).getValue()
email_sheet.getRange(range).setValue(existing_val+ params['submission']);
}
@tansaku
tansaku / gist:3959565
Created October 26, 2012 15:51
convert integer to spreadsheet column name, a, b, c, ... aa, etc.
function colName(n) {
var s = "";
while(n >= 0) {
s = String.fromCharCode(n % 26 + 97) + s;
n = Math.floor(n / 26) - 1;
}
return s;
}
@tansaku
tansaku / gist:4006793
Created November 3, 2012 09:36
Yoshi ruby
"Total number is #{2+3}"
@tansaku
tansaku / gist:4059533
Created November 12, 2012 13:57
adjusting unity executable permissions on OSX
localhost:MacOS samueljoseph$ cd ~/download
-bash: cd: /Users/samueljoseph/download: No such file or directory
localhost:MacOS samueljoseph$ cd ~/downloads
localhost:downloads samueljoseph$ cd Builds
localhost:Builds samueljoseph$ ls
Databases Prototypev2b60_64bit.exe
Prototype2b60_Mac.app Prototypev2b60_64bit_Data
Prototypev2b60_32bit.exe UnityPlayer_Symbols.pdb
Prototypev2b60_32bit_Data
localhost:Builds samueljoseph$ cd Prototype2b60_Mac.app/
@tansaku
tansaku / gist:4060057
Created November 12, 2012 15:43
Walls and Noses
"Walls and Noses"
Eight-Walled Chamber is a room. "A perfectly octagonal room whose walls are tinted in various hues."
Understand "wall" as a direction.
Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.
Rule for asking which do you mean when everything matched is direction: say "In which direction?"
To decide whether (N - an object) fits the parse list:
@tansaku
tansaku / display_assignment_status.feature
Created November 15, 2012 14:26
Display Assignment Status Prominently feature
Feature: display assignment status prominently on homepage
As a busy student
So that I can quickly determine what outstanding assignments I have
And so that I can quickly submit assignments
I want the first thing I see to be the assignment management page
Background: assignments have been added to the database
Given the following assignments exist
1. Feature: Generating reports on meetings
As a Project Manager
So I can report summarized extensive data
I want a reportable copy of separate notes during meetings
Complexity: Currently Complex - hoping to move to Average
2. Feature: Easy review of meetings
As a Project Manager
So I can organize my thoughts
@tansaku
tansaku / test.rb
Last active December 10, 2015 13:59
# testing getting stuff up to github
# testing getting stuff up to pastebin