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
def change a | |
smallcase = 'a'..'z' # smallcase.to_a.size #=> 26 | |
zeros = ("%026d" % 0).chars # creates array of 26 zeros | |
check = Hash[smallcase.zip(zeros)] #create hash map of alphabet to zeros | |
b = a.chars.each {|x| x.downcase!} | |
b.each do |x| | |
if check.include?(x) | |
check[x] = 1 | |
end |
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 RPS | |
# Rock, Paper, Scissors | |
# Make a 2-player game of rock paper scissors. It should have the following: | |
# | |
# It is initialized with two strings (player names). | |
# It has a `play` method that takes two strings: | |
# - Each string reperesents a player's move (rock, paper, or scissors) | |
# - The method returns the winner (player one or player two) | |
# - If the game is over, it returns a string stating that the game is already over | |
# It ends after a player wins 2 of 3 games |
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
require 'digest/sha1' | |
class SHA1Breaker | |
@@chars = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ".split("") | |
@@nums = "1234567890".split("") | |
@@lower = "abcdefghijklmnopqrstuvwxyz".split("") | |
def self.breaker(hash) | |
self.guesser(hash, @@chars) | |
end |
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
// Short-circuit examples | |
var one = 10 || 20 | |
console.log("1.", one) | |
var two = false || 30 | |
console.log("2.", two) | |
var three = true || 40 || 50 | |
console.log("3.", three) |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'mkmf' | |
USERNAME = `whoami`.chomp | |
HOME_DIR = File.expand_path('~/') | |
DOT_DIR = File.expand_path('~/.mks-dotfiles') | |
MKS_DIR = File.expand_path('~/code/mks') | |
DOT_FILES = ['.gitignore', '.gitconfig', '.zshrc'] |
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
How to write the perfect pull request | |
January 21, 2015 Keavy McMinn keavy Engineering | |
As a company grows, people and projects change. To continue to nurture the culture we want at GitHub, we've found it useful to remind ourselves what we aim for when we communicate. We recently introduced these guidelines to help us be our best selves when we collaborate on pull requests. | |
Approach to writing a Pull Request | |
Include the purpose of this Pull Request. For example: | |
This is a spike to explore… | |
This simplifies the display of… |
ECMAScript 6 git.io/es6features
ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targeting ratification in June 2015. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.
See the draft ES6 standard for full specification of the ECMAScript 6 language.
ES6 includes the following new features:
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
#!/bin/bash | |
echo "" | |
echo "==========================================================================" | |
echo "= Pentest Attack Machine Setup =" | |
echo "= Based on the setup from The Hacker Playbook =" | |
echo "==========================================================================" | |
echo "" | |
# Prepare tools folder |
OlderNewer