Skip to content

Instantly share code, notes, and snippets.

View ktilcu's full-sized avatar

kyle tilman ktilcu

View GitHub Profile
@ktilcu
ktilcu / .bashrc
Created June 20, 2012 14:13
Bash prompt for git branches
# Note that a variable may require special treatment
#+ if it will be exported.
DARKGRAY='\e[1;30m'
LIGHTRED='\e[0;31m'
GREEN='\e[32m'
YELLOW='\e[1;33m'
LIGHTBLUE='\e[1;34m'
NC='\e[m'
COLOR_OFF="\[\e[0m\]"
@ktilcu
ktilcu / branching.md
Created June 20, 2012 14:48
Branching in Git

#Branching

In our world of Git we will need to solve problems that may require more than one commit. In order to simplify the process while protecting our stable environment we have implemented a very specific branching system. This system was adopted from this website:

http://nvie.com/posts/a-successful-git-branching-model/

===========

##We are Independent

@ktilcu
ktilcu / gist:5082929
Created March 4, 2013 15:16
my .bash_profile
# aliases
alias ls='ls -G'
alias cd..="cd .."
alias l="ls -al"
alias lp="ls -p"
alias h='history'
alias mkdir='mkdir -p'
alias tunnel='ssh -nNT -R 19999:localhost:22 kyletilman@24.160.104.164 -p22'
alias la='ls -a'
alias ll='ls -l'
@ktilcu
ktilcu / palindrome.js
Last active August 16, 2017 00:02
kyle-Snippet: Longset Palindromic Substring
// Write a function that finds the longest palindromic substring in a string.
// ex: findLongstPal('affaptbbcracecarf') returns 'racecar'
// O(N^2)
function findLongestPalOld(input){
var longestPal = "";
var len = input.length;
var isPalindrome = function(palindrome){
return palindrome.split('').reverse().join('') == palindrome;
# [Notification Center](http://osxdaily.com/2012/08/06/disable-notification-center-remove-menu-bar-icon-os-x/)
## Disable
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall NotificationCenter # optional?
## Enable
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
# Spotlight
for own product, deployments of products
dpl = deployment for deployment in deployments when deployment.id and deployment.id is id
// Plinko.js
!function(){
'use strict';
function Plinko(){
var self = this,
app = require('http').createServer(handler),
io = require('socket.io').listen(app),
fs = require('fs'),
<!DOCTYPE html>
<html>
<head>
<title>Realtime Impressions</title>
<link rel="stylesheet" href="/ui_v2/css/main.css"/>
<style>
.container {
margin-top: 30px;
}
#placeholder {
@ktilcu
ktilcu / hex_colors.js
Last active August 15, 2017 23:48
kyle-Programming Problem: Manipulating Hex colors
function percentToHex(x, y) {
var c1 = '000000',
hex = ['0', '1','2','3','4','5','6','7','8','9','A', 'B', 'C', 'D', 'E', 'F'],
second = hex[Math.round(x*(hex.length-1))],
first= hex[Math.round(y*(hex.length-1))],
group = first+""+second,
hexStr = group+""+group+group;
return hexStr;
}
@ktilcu
ktilcu / buried.py
Last active August 15, 2017 23:40
kyle-Snippet: Kick buried beanstalk jobs and catalog them
import beanstalkc
f = open('myfile.json','w')
y = []
def process_buried_jobs(tube, buried):
beanstalk.use(tube)
x = 0
while x < buried:
job = beanstalk.peek_buried()