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 processData(input) { | |
var arr = input.split('\n'); | |
var len = arr[0]; | |
var res = ''; | |
for (var i = 1;i < arr.length; i++) { | |
if (i === arr.length - 1) { | |
res+=divider(arr[i]); | |
} else { | |
res+=divider(arr[i])+'\n'; | |
} |
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 React from 'react' | |
export default class WidgetMap extends React.Component { | |
render() { | |
const {mapBy, children, tagName, mapKeyName, ...props} = this.props | |
let defaultChild | |
const mk = mapKeyName || 'mapKey' | |
const widgets = (Array.isArray(children) ? children : [children]).filter(child => { | |
const mapKey = child.props[mk] |
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
/* eslint-disable */ | |
var gulp = require('gulp'); | |
var Facet = require('immutable-di/define').Facet; | |
var Container = require('immutable-di'); | |
var NativeCursor = require('immutable-di/cursors/native'); | |
var Setter = require('immutable-di/define').Setter; | |
var cursor = new NativeCursor({ |
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
LOCALE_EN := 0x4090409 | |
LOCALE_RU := 0x4190419 | |
CapsLock:: | |
if WinActive("ahk_class ConsoleWindowClass") { | |
PostMessage, 0x50, 0x02, 0,, A | |
} | |
else { | |
SetFormat, Integer, H | |
WinGet, WinID,, A | |
ThreadID := DllCall("GetWindowThreadProcessId", "UInt", WinID, "UInt", 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
Music For Hackers | |
== | |
To a hacker, there's something distracting about booting up a GUI to listen to your tunes. You live your life in the terminal, you treat the mouse like a high voltage tap. | |
So give these commands a run in the terminal, and toss on your headphones. | |
sudo apt-get install mplayer | |
echo "alias defcon-start='nohup mplayer http://sfstream1.somafm.com:6200 > /dev/null 1>&2 &'" >> ~/.bashrc | |
echo "alias defcon-stop='killall -9 mplayer'" >> ~/.bashrc |
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
"url\\([\"'\s]*([^'\"()]+?)[\"'\s]*\\)(\s+(-?\d+)(?:px)?\s+(-?\d+)(?:px)?)?" | |
Matching url() at css rule |
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
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = tab | |
[*.{dart,less}] | |
end_of_line = lf |
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
https://seanlin0800.gitbooks.io/async-performance/content/source/ch4/breaking_run_to_completion.html |
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
void main() { | |
int i, b = 1, n = 11; | |
final mas = new List(n); | |
mas[0] = 1; | |
for (i = 1; i < n; i++) { | |
mas[i] = b; | |
b = mas[i-1] + b; | |
} | |
for (i = 0; i < n; i++) { |
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 'dart:async'; | |
void main() { | |
final controller = new StreamController<int>(); | |
controller.add(10); | |
controller.stream.listen((a) => print('receive: $a')); | |
final contrtoller2 = new StreamController<int>.broadcast(); | |