Skip to content

Instantly share code, notes, and snippets.

View vgmoose's full-sized avatar
🌱
making my way downtown, walking fast

vgmoose vgmoose

🌱
making my way downtown, walking fast
View GitHub Profile
@vgmoose
vgmoose / gradeCheck.js
Created May 13, 2014 01:41
phantomjs --ignore-ssl-errors=true --load-images=no --ssl-protocol=tlsv1 gradeCheck.js
// Example using HTTP POST operation
var username = "USERNAME"; // must be all capitalized
var pass = "password";
var page = require('webpage').create();
var server = 'https://www.spire.umass.edu/psp/heproda/';
var data = 'userid='+username+'&pwd='+pass+'&languageCd=ENG&timezoneOffset=0&Submit=Go&cmd=login';
page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9';
@vgmoose
vgmoose / howto
Created June 17, 2014 12:03
spoof.pl
print(" Old:");
print(`ifconfig en0 | grep ether`);
$oldmac=sprintf(`ifconfig en0 | grep ether`);
do{
if (length($ARGV[$0])==17)
{$mac=$ARGV[$0]."\n";}
elsif (length($ARGV[$0])!=0)
{
print(" New: ether ".$ARGV[$0]."\n");
die();
from Tkinter import *
import os
def set_values(val):
os.system("echo "+str(val)+" > /sys/class/backlight/acpi_video0/brightness")
def stay_open():
pass
master = Tk()
<vgmoose> bamboo: link rayoub
<rayoub> bamboo: link vgmoose
<bamboo> rayoub and vgmoose are linked
the "main" account which will be shown is whichever spoke last
the preference for scrambling is not linked
karma is still tracked separately, but added together for linked usernames
both nicks must link the other nick for them to be connected
<vgmoose> bamboo: unlink rayoub
import pickle, os
# get all dotfiles (which could potentially contain dumped data
dotfiles = [x for x in os.listdir('.') if x.startswith('.')]
objects = []
filenames = []
for filename in dotfiles:
try:
import json, urllib2, sys
with open("/usr/share/dict/words") as word_file:
english_words = set(word.strip().lower() for word in word_file)
def is_word(word):
return word.lower() in english_words
try:
since = sys.argv[1]
public static void study(FlashCard[] cards)
{
LinkedList<FlashCard> queue = new LinkedList<FlashCard>();
for (FlashCard c : cards)
queue.add(c);
do
{
LinkedList<FlashCard> correct = new LinkedList<FlashCard>();

Snippet 1

goes in CVDCollectionViewController.m, replaces existing viewDidLoad

- (void)viewDidLoad
{
    // Do any additional setup after loading the view.
    [super viewDidLoad];
    
    // color the CollectionView's background color
    self.collectionView.backgroundColor = [UIColor colorWithHue:.5 saturation:.3 brightness:.4 alpha:1];
@vgmoose
vgmoose / ttg.markdown
Last active August 29, 2015 14:09
Taps Touches and Gestures

Simple Taps

Snippet 1.1

this is what the resulting control+drag from the UILabel to STViewController.m should look like

@property (weak, nonatomic) IBOutlet UILabel *tapStatus;

Snippet 1.2

goes in body of STViewController.m

@vgmoose
vgmoose / bitmap.py
Last active April 14, 2022 08:57
number of islands in a bitmap
# initial island map
bitmap = [
[0,0,1,1,0,0,0,1,0,0],
[0,1,1,0,0,1,1,1,0,0],
[0,1,0,0,0,0,0,0,0,0],
[0,0,0,1,1,1,0,0,1,1],
[0,0,0,0,1,1,1,1,1,0],
[0,1,1,0,0,0,0,0,0,0]
]