Skip to content

Instantly share code, notes, and snippets.

Sascha pid

Block or report user

Report or block pid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost
View bootstrapping.md

Welcome!

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.


  • OpenStrategy - kinda like this list, but much nicer presentation
View KellyColors.elm
module KellyColors exposing (..)
import Color exposing (..)
import Maybe exposing (..)
import List.Extra as List exposing (..)
type alias KellyDef =
{ isccNbsNr : Int, hexString : String, r : Int, g : Int, b : Int }
@pid
pid / Readme.md
Last active Oct 13, 2016 — forked from rauchg/Readme.md
Minimum Viable Async with Node 6
View Readme.md

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@pid
pid / a.js
Created Sep 23, 2016 — forked from isaacs/a.js
View a.js
var Module = require('module')
Module.prototype.require = function (orig) { return function (id) {
console.trace(this, id)
return orig.apply(this, arguments)
}}(Module.prototype.require)
require('./b.js')
View config.fish.sh
# Fish 2.0 config
# Enviroment setup
clear
set -x NODE_PATH /usr/local/lib/node_modules
set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH
set -e fish_greeting
@pid
pid / introrx.md
Created Mar 22, 2016 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@pid
pid / info.plist
Created Jan 8, 2016 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
View info.plist
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@pid
pid / Makefile
Last active Aug 29, 2015 — forked from isaacs/Makefile
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
View factorialWithLambdaCalc.js
// Y Combinator
// makes the recursion
(function(improver) {
return (function(gen) { return gen(gen) })(
function(gen) {
return improver(function(v) {
return gen(gen)(v)
})
}
)
You can’t perform that action at this time.