This file contains 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
(async () => { | |
// logs to just to make sure that stuff is really asynchronous | |
// setInterval(() => console.log('--'), 200) | |
function iterWrap(iter) { | |
return { | |
take: (n = 100) => { | |
function* limitedGenerator() { | |
for(let i = 0; i < n; i++) { |
This file contains 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://gist.github.com/josmardias/20493bd205e24e31c0a406472330515a | |
// at least one timeout needs to be set, larger then your code bootstrap | |
// or Nashorn will run forever | |
// preferably, put a timeout 0 after your code bootstrap | |
(function(context) { | |
'use strict'; | |
var Timer = Java.type('java.util.Timer'); | |
var Phaser = Java.type('java.util.concurrent.Phaser'); |
This file contains 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
#!/usr/bin/env bash | |
VOLUME_NAME="test-postgres-data" | |
CONTAINER_NAME="test-postgres9.4" | |
PGPASSWORD="password" | |
DATABASE="test" | |
( | |
echo -e "\ncreating persistent volume...\n"; | |
docker create -v /var/lib/postgresql/data --name $VOLUME_NAME busybox |
This file contains 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
# fix multiple entries when .bashrc is sourced multiple times | |
if [ -z "$ORIGINAL_PATH" ]; then | |
export ORIGINAL_PATH="$PATH" | |
fi | |
if [ -z "$ORIGINAL_MANPATH" ]; then | |
export ORIGINAL_MANPATH="$MANPATH" | |
fi | |
if [ -z "$ORIGINAL_INFOPATH" ]; then | |
export ORIGINAL_INFOPATH="$INFOPATH" | |
fi |
This file contains 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
console.log("----------------------------------------------------------"); | |
console.log("-- first of all, in JS, functions can be used as is, or called from objects"); | |
var myf = function () { | |
return 1; | |
}; | |
// as function | |
console.log(myf()); | |
//as object method |
This file contains 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
1) Install ATrpms repository (http://atrpms.net/) | |
sudo rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms | |
echo ' | |
[atrpms] | |
name=Fedora Core $releasever - $basearch - ATrpms | |
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable | |
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms | |
gpgcheck=1' | sudo tee /etc/yum.repos.d/atrpms.repo |
This file contains 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
$ curl -L http://bootstrap.saltstack.org | sudo sh -s -- -D -M -N git v0.15.3 | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 256 100 256 0 0 288 0 --:--:-- --:--:-- --:--:-- 1273 | |
0 256 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 * INFO: PIPED THROUGH sh -- Version 1.5.5 | |
* INFO: System Information: | |
* INFO: CPU: GenuineIntel | |
* INFO: CPU Arch: x86_64 | |
* INFO: OS Name: Linux |