This file contains hidden or 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 | |
git branch --merged | while read line | |
do | |
# If the line is in the format '* master' (indicating the current branch), | |
# this will be effectively empty, so we don't somehow delete the current | |
# branch | |
BRANCH=`echo "$line" | awk -F '*' '{ print $1 }'` | |
if [ -z "$BRANCH" ] |
This file contains hidden or 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 watchThatWindow = new ObservableWindow(); | |
watchThatWindow.WindowCreated | |
.Select(hwnd => NativeMethods.GetWindowTitle(hwnd)) | |
.Subscribe(x => Console.WriteLine($"Say hello to '{x}'!")); |
This file contains hidden or 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
import android.app.Activity | |
import android.bluetooth.BluetoothGattCharacteristic | |
import android.os.Bundle | |
import android.util.Log | |
import com.github.ivbaranov.rxbluetooth.RxBluetooth | |
import com.polidea.rxandroidble.RxBleClient | |
import com.polidea.rxandroidble.RxBleConnection | |
import com.polidea.rxandroidble.RxBleDevice | |
import com.polidea.rxandroidble.scan.ScanSettings | |
import rx.Observable |
This file contains hidden or 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
ObservableKeyboard.InputProfileChanged | |
.Subscribe(_ => Console.WriteLine("Hey it changed!")); |
This file contains hidden or 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
import * as fs from 'fs'; | |
import * as path from 'path'; | |
import * as glob from 'glob'; | |
import * as cheerio from 'cheerio'; | |
const files = glob.sync(path.join(__dirname, '**/*.html')); | |
const filesAndContent = files.reduce((acc, x) => { | |
let $ = cheerio.load(fs.readFileSync(x, 'utf8')); |
This file contains hidden or 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
export interface SortedArrayOpts { | |
filter?: Function; | |
compare?: Function | string; | |
unique?: boolean; | |
resume?: boolean; | |
} | |
export class SortedArray<T> extends Array<T> { | |
private readonly _filter: Function; | |
private readonly _compare: Function; |
This file contains hidden or 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
// | |
// WRONG | |
/// | |
class InMemorySparseMap<K, V> implements SparseMap<K, V> { | |
private latest: Map<K, Updatable<V>>; | |
private factory: ((key: K) => Observable<V>) | undefined; | |
subscribe(key: K): Updatable<V> { | |
let ret = this.latest.get(key); |
This file contains hidden or 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
runtime = electron | |
target = 1.4.12 // REPLACE ME WITH VERSION | |
target_arch = x64 // REPLACE ME WITH WHATEVER process.arch IS | |
disturl = https://atom.io/download/atom-shell | |
tag-version-prefix = "" | |
build_from_source = true |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
use std::cell::RefCell; | |
use std::collections::LinkedList; | |
use std::sync::atomic::*; | |
pub trait Subscription { | |
fn unsubscribe(&mut self); | |
fn closed(&self) -> bool; | |
} | |
/* |