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 { OpaqueToken } from '@angular/core'; | |
import { Subject } from 'rxjs/Subject'; | |
import 'rxjs/add/operator/do'; | |
import 'rxjs/add/operator/scan'; | |
import 'rxjs/add/operator/observeOn'; | |
import { queue } from 'rxjs/scheduler/queue'; | |
import { ReplaySubject } from 'rxjs/ReplaySubject'; | |
export interface Action { | |
type: string; |
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
{- | |
Implementation of "Heathrow to London" algorithm | |
from a task in the book "Learn you a Haskell" | |
http://learnyouahaskell.com/functionally-solving-problems | |
Example input: | |
``` | |
$ echo "50 10 30 5 90 20 40 2 25 10 8 0 " | tr ' ' '\n' | runhaskell heathrow-to-london.hs | |
``` |
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
{"lastUpload":"2017-05-04T19:44:30.519Z","extensionVersion":"v2.7.0"} |
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
bind -T root F12 \ | |
set prefix None \;\ | |
set key-table off \;\ | |
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\ | |
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\ | |
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\ | |
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\ | |
refresh-client -S \;\ | |
bind -T off F12 \ |
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
# show status bar at bottom for remote session, | |
# so it do not stack together with local session's one | |
set -g status-position bottom | |
# In remote mode we don't show "clock" and "battery status" widgets | |
set -g status-left "$wg_session" | |
set -g status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host | #{online_status}" |
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
function r(genFn, context){ | |
return function(...args){ | |
const iter = genFn.apply(context || this, args); | |
return traverse(iter); | |
} | |
function traverse(iter){ | |
return new Promise((res, rej) => { | |
function step(err, arg) { |
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 a module with side-effect without any import bindings | |
import 'jquery'; | |
// import the default export of a module | |
import $ from 'jquery'; | |
// import a named export of a module | |
import { reduce } from 'underscore'; | |
// import a named export to a different name |
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
function ToPrimitive(input, preferredType){ | |
switch (preferredType){ | |
case Number: | |
return toNumber(input); | |
break; | |
case String: | |
return toString(input); | |
break | |
default: |
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
let d = new Date(); | |
// get string representation | |
let str = d.toString(); // 'Wed Jan 17 2018 16:15:42' | |
// get numeric representation, num of milliseconds since Unix epoch | |
let num = d.valueOf(); // 1516198542525 | |
// compare with a string representation | |
// true because d is converted to same string |
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 obj = { | |
prop: 101, | |
toString(){ | |
return 'Prop: ' + this.prop; | |
}, | |
valueOf() { | |
return this.prop; | |
} | |
}; |