Skip to content

Instantly share code, notes, and snippets.

View texel's full-sized avatar

Leigh Caplan texel

View GitHub Profile
import {Observable} from 'rxjs';
/**
* A decorator for Angular 2 component instance properties that enables
* them to automatically receive values from an Observable of the same type.
*
* In many cases, it's easier to deal with bare values in a view, while
* pushing value changes from an Observable. `Sink()` wraps up this pattern
* and automatically manages subscription disposal.
*

Keybase proof

I hereby claim:

  • I am texel on github.
  • I am texel (https://keybase.io/texel) on keybase.
  • I have a public key whose fingerprint is 4DB9 6F96 FD3E 2C8A 7400 388F E580 4D76 9B56 ED55

To claim this, I am signing this object:

var returnMeAFunction = function () {
var integer = 1;
var string = "Pancakes";
var f = function () {
console.log("integer is " + integer + " and string is " + string + ".");
}
return f;
}
var wrapper = function() {
var internalVar = 1
var internalFunction = function () {
console.log("internalVar:", internalVar);
}
return internalFunction;
}
var capturedFunction = wrapper();
@texel
texel / sidechain.md
Last active January 3, 2016 06:59
Multiband Sidechain bass to kick

First, you'll need a rack that allows you to split processing into multiple bands. The ones in here might be a good starting point: https://forum.ableton.com/viewtopic.php?f=1&t=199201&view=next

For this, you'll only need a low and high band. The high band gets left alone. In the low band, place a compressor, and set its sidechain input to your kick (or whatever signal you want to duck with). Set the ratio and threshold to taste- if you cut all the low-end out when the kick hits, things might sound unnatural. Also, play with the crossover frequency of your rack– there should be a sweet spot where you're getting a nice bit of extra headroom from the low frequencies ducking, but you're still able to hear the mids/highs of the ducked sound without audible "pumping."

// Observe click events on h1 elements
$('h1').on('click', function( event ) {
// This is the body of the click handler.
// Notice we were passed the click event as a parameter.
// From in here, we can access event to get info about it.
var h1 = event.currentTarget;
// Interestingly, "this" also refers to the item that was clicked
h1 == this; // would evaluate to true
.wishlist-grid {
background-color: #cbcccd;
float: left;
width: 200px;
height: 200px;
margin: 10px 10px 10px 0;
padding: 5px;
}
#!/usr/bin/env ruby
diff_body = `git diff --staged`
# Detect whether we're adding a :focus => true line in a spec file
focus_regex = /^\+.*(describe|context|it).*:focus/
if diff_body =~ focus_regex
puts "\nAttempting to commit a spec with :focus => true. Aborting...\n\n"
class String
def palindrome?
head = 0
tail = length - 1
while head <= tail
# Normalize head
head += 1 while self[head] && (self[head] =~ /\W/)
# Normalize tail
# Monkey patch Autotest...
class Autotest
def find_files
result = {}
targets = self.find_directories + self.extra_files
self.find_order.clear
targets.each do |target|