Skip to content

Instantly share code, notes, and snippets.

View ckahle33's full-sized avatar
🏠
Working from home

Craig Kahle ckahle33

🏠
Working from home
  • Meow Wolf
  • Taos, NM
View GitHub Profile
class Tree:
def __init__(self):
self.nodes = []
self.root = None
def add_node(self, node=None):
if node:
self.nodes.append(node)
def list_nodes(self):
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Craig Kahle",
"label": "Cloud Solutions / Web Engineer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "Full stack web developer with a focus on infrastructure automation",
"website": "https://craigkahle.com",
### Keybase proof
I hereby claim:
* I am ckahle33 on github.
* I am cpk (https://keybase.io/cpk) on keybase.
* I have a public key ASB6SyX8-q__Ek0AgTZKcEcaWCHgH6lV4ugwyH5bdigEvAo
To claim this, I am signing this object:
# gem install mechanize
require 'mechanize'
class Download
def initialize(site, email, pass)
@options = {site: site, email: email, pass: pass}
end
def call
$(document).on('scroll', function(e){
console.log($(this).scrollTop());
if ($(this).scrollTop() > $(".reddit-infobar").offset().top) {
//toggle a class instead here
$(".reddit-infobar").css('position', 'fixed')
}
})
@ckahle33
ckahle33 / arraySort.js
Last active April 11, 2016 18:54
array Sort
// [2, 1, 1]
// x = 2
// [[2], [1], [1]]
// 1, 1], [2]]
// [2, 2, 1, 1, 2, 2, 2]
// x = 3
// [[2, 1], [2, 1]]
//assumes input is an array.. would normally error handle / check it
@ckahle33
ckahle33 / pangram.js
Created March 25, 2016 20:01
Pangram test
function processData(input) {
var alpha = 'abcdefghijklmnopqrstuvwxyz'.split('')
var inputArr = input.split('');
var countArr = []
inputArr.forEach(function(i){
i = i.toLowerCase();
if (alpha.indexOf(i) >= 0 && countArr.indexOf(i) === -1 ) {
countArr.push(i);
}
@ckahle33
ckahle33 / build_script.sh
Created March 5, 2016 20:54
build_script.sh
sudo apt-get install zsh &&
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" &&
gem install bundler &&
cd /var/www/public/mixalist &&
sudo apt-get update &&
sudo apt-get install libpq-dev &&
bundle install &&
rake db:create db:migrate &&
puma
// Sample HTML
//<video id="video1" controls>
// <source src="/path/to/video.webm" type="video/webm">
//</video>
// <div class="playButton"></div>
// realistically you would create custom play buttons so you can control from JS
var video = document.getElementById("video1");
var playButton = document.getElementsByClassName("playButton")[0];
@ckahle33
ckahle33 / gist:33c23c0ee1a287a0c48b
Last active August 29, 2015 14:26
force play of <video>
var video = document.getElementByTagName("video")[0];
video.addEventListener("click", function(event){
this.play()
})