Skip to content

Instantly share code, notes, and snippets.

View shrugs's full-sized avatar
💭
welcome to my aim profile!! ~~~~ xoxoxo !linkin^park^lover! xoxoxo ~~~

shrugs shrugs

💭
welcome to my aim profile!! ~~~~ xoxoxo !linkin^park^lover! xoxoxo ~~~
View GitHub Profile
@shrugs
shrugs / TwitterHappy.py
Created October 13, 2012 04:59
Percentage of Happy Twitter Users
import tweepy
import matplotlib.pyplot as plt
from time import time
#number of statuses logged
status_count = 0
#set up auth
auth1 = tweepy.auth.OAuthHandler('Consumer Key','Consumer Secret')
auth1.set_access_token('Auth Key','Auth Secret')
@shrugs
shrugs / Slingshots.cy
Created June 30, 2014 00:36
Get the public url for any locked or unlocked slingshot photo currently in memory.
choose(SHShot).map(function(s){return s.mediaURI})
@shrugs
shrugs / gist:edd5485b8b4c03c1ff66
Created March 30, 2015 20:58
flexy scrollview behavior
// MARKUP
<View style={[styles.container, styles.containerSearching]}>
<View ref="container" style={styles.innerContainer}>
<TextInput ref="miniSearchBox"
style={styles.searchBox} />
@shrugs
shrugs / google.script.run.promise.js
Last active July 17, 2019 08:10
google.script.run promise wrapper
// turns google.script.run into an object with a promise api
function scriptRunPromise()
var gs = {};
var ks = Object.keys(google.script.run);
for (var i=0; i < ks.length; i++) {
gs[ks[i]] = (function(k) {
return function() {
var args = arguments;
return Promise(function(resolve, reject) {
google.script.run
{
"shell_cmd": "gaps upload",
"working_dir": "${project_path:${folder}}"
}
// optional
// if you're using i3, focus chrome with
{
"shell_cmd": "gaps upload; i3-msg '[title=\"Google Chrome\"] focus'",
@shrugs
shrugs / UIColor+Chameleon.swift
Last active September 25, 2015 06:59
UIColor+Chameleon.swift
//
// UIColor+Chameleon.swift
//
import UIKit
func hsb(h: Double, _ s: Double, _ b: Double) -> UIColor {
let hue = CGFloat(h/360.0)
let saturation = CGFloat(s/100.0)
let brightness = CGFloat(b/100.0)
@shrugs
shrugs / README.md
Last active May 11, 2017 08:58
EFK Logging Deployments for Kubernetes 1.3+, for use with kops

The kubernetes.io/cluster-service annotation are commented out because I was having issues with kubernetes deleting my deployments.

The StorageClass resource is commented out because I'm still on 1.3.7 (upgrading to 1.4 as we speak) and am using emptyDirs for now.

Note that in kibana, your logs are tagged with logstash-* even though we're using fluentd; it's due to the default fluentd config in the gcr image. Maybe someone will get around to fixing that eventually?

@shrugs
shrugs / Dockerfile
Created October 18, 2016 20:34
Custom kops elasticsearch image
FROM gcr.io/google_containers/elasticsearch:1.9
COPY elasticsearch.yml /elasticsearch-1.5.2/config/elasticsearch.yml
COPY logging.yml /elasticsearch-1.5.2/config/logging.yml
@shrugs
shrugs / keybase.md
Created November 10, 2016 03:23
Keybase Verification

Keybase proof

I hereby claim:

  • I am shrugs on github.
  • I am shrugs (https://keybase.io/shrugs) on keybase.
  • I have a public key ASDZq0by_cAcD7Jaeyql-Xi-jw4dNHTHDp6HToT9pDuDmgo

To claim this, I am signing this object: