This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install mechanize | |
require 'mechanize' | |
class Download | |
def initialize(site, email, pass) | |
@options = {site: site, email: email, pass: pass} | |
end | |
def call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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') | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var video = document.getElementByTagName("video")[0]; | |
video.addEventListener("click", function(event){ | |
this.play() | |
}) |
NewerOlder