$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.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
describe('Authentication', function() { | |
it('errors if wrong basic auth', function(done) { | |
api.get('/blog') | |
.set('x-api-key', '123myapikey') | |
.auth('incorrect', 'credentials') | |
.expect(401, done) | |
}); | |
it('errors if bad x-api-key header', function(done) { |
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 bin_search(L, a): | |
if (len(L) == 1): | |
return "NO" | |
mid = len(L) // 2 | |
if (a < L[mid]): | |
return bin_search(L[:mid], a) | |
elif (a > L[mid]): | |
return bin_search(L[mid:], a) |
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
$columns: 12; | |
$grid-breakpoints: ( | |
xs: 0, | |
sm: 544px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px | |
); |
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 'thread' | |
class Waiter | |
def initialize | |
@mutex = Mutex.new | |
end | |
def can_eat? philosopher | |
left = philosopher.left_fork | |
right = philosopher.right_fork |
###Redux Egghead Video Notes###
####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.
Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.
####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree
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
# Procedure is for Ubuntu 14.04 LTS. | |
# Using these guides: | |
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/ | |
# https://turboflash.wordpress.com/2009/06/23/curl-adding-installing-trusting-new-self-signed-certificate/ | |
# https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/ | |
# Generate the root (GIVE IT A PASSWORD IF YOU'RE NOT AUTOMATING SIGNING!): | |
openssl genrsa -aes256 -out ca.key 2048 | |
openssl req -new -x509 -days 7300 -key ca.key -sha256 -extensions v3_ca -out ca.crt |
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 python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |
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
/* | |
A Minimal Capture Program | |
This program opens an audio interface for capture, configures it for | |
stereo, 16 bit, 44.1kHz, interleaved conventional read/write | |
access. Then its reads a chunk of random data from it, and exits. It | |
isn't meant to be a real program. | |
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html |
OlderNewer