Skip to content

Instantly share code, notes, and snippets.

; dir 0 = top part
; dir 1 = bottom part
; size 0 = half of screen
; size 1 = third of screen
ResizeWin(dir = 1, size = 0)
{
WinGet activeWin, ID, A
activeMon := GetMonitorIndexFromWindow(activeWin)
@sachleen
sachleen / gitpull.php
Last active December 4, 2017 06:03
Deploy With Git
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
* Used for automatically deploying websites via github securely, more deets here:
*
* https://gist.github.com/limzykenneth/baef1b190c68970d50e1
*
* Put a .gitpullsecretkey file with the webhook secret somewhere not publicly accessible and reference the path on line 49
* If the git repo is in a different directory than this file, you have two options:
@sachleen
sachleen / gist:762b2129658a8db929fa
Created May 16, 2014 00:17
arduino motor examples for SN754410
First get the value of the pot.
http://www.arduino.cc/en/Tutorial/Potentiometer
int potValue = value of pot... current position from 0 to 1023
======================================================================
Set the direction based on pot value. If it's one way, it'll spin CW, if its another, it'll spin CCW
Based on example from http://web.ics.purdue.edu/~fwinkler/616/sn754410_Arduino.pdf
if (potValue > 512) {
@sachleen
sachleen / TV Shows
Created January 10, 2014 04:30
Parses the TVRage.com rss feeds to check which of my TV shows airs today, tomorrow, or aired yesterday.
import re, feedparser
myShows = ("Community", "Futurama", "Graceland", "Homeland", "New Girl", "Psych", "Suits", "Amazing Race", "Simpsons", "Big Bang Theory", "Parks and Recreation", "Walking Dead")
feeds = ("http://www.tvrage.com/myrss.php", "http://www.tvrage.com/myrss.php?date=tomorrow", "http://www.tvrage.com/myrss.php?date=yesterday")
def main():
for feed in feeds:
print "Checking feed {0}".format(feed)
results = filterFeed(feed, myShows)
@sachleen
sachleen / ajax.php
Last active September 29, 2015 13:47
Notepad
<?php
header('Content-Type: text/html; charset=ISO-8859-15');
date_default_timezone_set('America/Los_Angeles');
if(isset($_POST['action']) && isset($_POST['key']) && $_POST['key'] == "yoursecret")
{
$file = "notes.txt";
switch($_POST['action']) {
case "get":