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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
text-align: center; | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; |
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
type Mixtype = String|Number; | |
class SomeClass<T extends Mixtype> { | |
somemethod(arg: T): T { | |
return arg; | |
} | |
} | |
var somevar = new SomeClass<Number>(); | |
console.log(somevar.somemethod(123)); |
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
$('.searchform').submit(function (event) { | |
var mode = $(this).find("input[name='mode']:checked").val(); | |
var keyword = $(this).find("input[name='keyword']").val(); | |
var endpoint = mode === 'srh' ? '/?mode=srh&keyword=' + keyword : '/note/?s=' + keyword; | |
// set new endpoint | |
// $(this).attr('action', endpoint); | |
// prevent default event action | |
event.preventDefault(); |
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 params = {}; | |
var keyUpStream = null; | |
var requestStream = null; | |
keyUpStream = Rx.Observable | |
.fromEvent(this.$el, 'keyup') | |
.map(function (event) { return event.target.value; }) | |
.distinctUntilChanged(); | |
requestStream = keyUpStream |
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 a = Rx.Observable.fromEvent(document, 'click') | |
.flatMapLatest(function () { | |
return Rx.Observable.defer(function () { | |
return new Promise(function (resolve) { | |
setTimeout(function () { resolve('hey'); }, 2000); | |
}); | |
}); | |
}); | |
var b = a.subscribe(function () { console.log(arguments[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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>RxJS Playground</title> | |
<style> | |
body { | |
padding-top: 50px; | |
} | |
.cube { |
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
ssh -i ~/.vagrant.d/insecure_private_key 192.168.100.109 ' | |
HOST='0.0.0.0' | |
USERNAME=root | |
PASSWORD=root | |
DATABASE=mystore2 | |
TABLES='mysql --host=$HOST --user=$USERNAME --password=$PASSWORD --database=$DATABASE --batch --silent --execute \'SHOW TABLES LIKE \'chips_%\'\'' | |
mysqldump --host=$HOST --user=$USERNAME --password=$PASSWORD --no-data $DATABASE $TABLES | |
' > test.sql |
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
ssh -i ~/.vagrant.d/insecure_private_key 192.168.100.109 <<- ENDSSH > test.txt | |
mysqldump -h0.0.0.0 -uroot -proot -d mystore2 mysql -h0.0.0.0 -uroot -proot -D mystore2 -Bse "SHOW TABLES LIKE 'chips_%'" | |
ENDSSH | |
ssh -i ~/.vagrant.d/insecure_private_key 192.168.100.109 ' | |
HOST=0.0.0.0 | |
USERNAME=root | |
PASSWORD=root | |
DATABASE=mystore2 |
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
## | |
# Environment Variables | |
## | |
NAMESPACE=oliverlundquist | |
TAG=latest | |
NETWORK_NAME=mystore-api | |
REPO_PATH=~/repositories/mystoreno/mystore-api | |
NGINX_ID=`docker ps | grep $(NAMESPACE)/nginx:$(TAG) | cut -d ' ' -f1` | |
PHP_ID=`docker ps | grep $(NAMESPACE)/php7:$(TAG) | cut -d ' ' -f1` |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style>.letter { position: absolute; font-size: 15px; }</style> | |
</head> | |
<body> | |
<div class="letter">k</div> | |
<div class="letter">u</div> | |
<div class="letter">r</div> |