Skip to content

Instantly share code, notes, and snippets.

View sirkitree's full-sized avatar

Jerad Bitner sirkitree

View GitHub Profile
@MrM0bius
MrM0bius / janus-rand-wlocalcache.php
Created November 15, 2014 16:26
JanusVR Random r/vrsites link generator
<?php
$options = array('http' => array('user_agent' => 'JanusVR random site (v0.1)'));
$context = stream_context_create($options);
if (isset($_GET['refresh'])){
$rvrsites1 = file_get_contents('http://reddit.com/r/vrsites/.json?limit=100', false, $context);
$rvrsites2 = file_get_contents('http://reddit.com/r/vrsites/.json?count=100&after=t3_2akppo&limit=100', false, $context);
if ($rvrsites1 === false) {
die();
@ericduran
ericduran / 8hr delete.js
Created January 9, 2013 22:01
Enhancing my gmail filters!
/**
* Using Google Apps Script to enhance my gmail filters.
*
* I constantly receive email that are important for a short period of time (When I order food online!!!!) but after
* the email is no longer relative (When I get my food!) I have no need for this email. Sadly they tend to pile up on me
* (I eat a lot).
*
* Anyways you can add this 8hrDelete.gs file to https://script.google.com and set it up on a "Time Driven" trigger at what
* ever time you'll like. I run it at midnight
*/
@eojthebrave
eojthebrave / yammer_test.html
Created November 16, 2012 17:52
Yammer | OAuth 2 | Implicit Grant
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
var match = hash.match(/access_token=(\w+)/);
return !!match && match[1];
};
@q0rban
q0rban / gitosnap.sh
Created November 16, 2012 16:03
Monosnap/Github Shell Script
#!/usr/bin/env sh
# https://gist.github.com/4088499
FIND="^monosnap.com\/image\/\([a-zA-Z0-9]*\)"
REPLACE="![](https:\/\/api.monosnap.com\/image\/download\?id=\1)"
pbpaste |
# Different versions of monosnap have this formatted differently, so we grep
# first for just what we need.
grep -o monosnap.com/image/[a-zA-Z0-9]* |
# Grab the current cliboard contents and do our replacement.
@sirkitree
sirkitree / drushrc.php
Created November 6, 2012 12:36
Don't allow yourself to screw up with sql-sync to the production environment.
<?php
$options['shell-aliases']['syncdb'] = '!drush --verbose --yes sql-sync --create-db @pac12.prod @self';
@jaseg
jaseg / gist:3334991
Created August 12, 2012 22:32
Password manager without a password manager

Prelude

Since password managers are big and complicated and I currently am pretty bored since I am sitting in a car for a few hours, here is a simple algorithm to generate resource-specific, unique passwords using a master password and no password database.

WARNING

As pointed out here: http://news.ycombinator.com/item?id=4374888 this method is broken.

Usage

@sreynen
sreynen / basecamp.php
Created August 2, 2012 15:06
Time report
<?
require_once('basecamp/Basecamp.class.php'); // see http://code.google.com/p/basecamp-php-api/
$bc = new Basecamp('https://[subdomain].basecamphq.com/','[username]','[password]', 'simplexml');
$people = $bc->getPeopleForCompany([company ID]);
$person_id = array();
foreach ($people['body']->person as $person) {
@pixelwhip
pixelwhip / _variables.scss
Created April 18, 2012 05:34
Sample scss files for establishing a baseline for a new site. I've been starting every project with a variation of these files. They get refined each time and have proved super useful.
//
// @file
// Sitewide imports, variables and mixins.
//
@import "compass/css3";
@import "compass/typography";
@import "sassy-buttons";
@import "utilities";
@import "grids";
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#