Skip to content

Instantly share code, notes, and snippets.

@stellaraccident
stellaraccident / control-block-http-example1.js
Created March 21, 2011 20:05
Bulletproof node coding snippets
request: function(options) {
var future=new Future();
var req=http.request(options, function(res) {
var text='';
res.setEncoding('utf8');
res.on('data', function(chunk) {
text+=chunk;
});
res.on('end', Block.guard(function() {
@cdown
cdown / gist:1163649
Last active July 1, 2024 03:35
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@josefsalyer
josefsalyer / notes
Created October 31, 2011 15:16
notes
10:9a:dd:b9:83:3e Hernan
7C:6D:62:D2:E4:0D Hernan's iPad
90:27:e4:fb:3a:7c Frederico
Frank
https://github.com/moredip/Frank
http://blog.thepete.net/2010/07/frank-automated-acceptance-tests-for.html
http://vimeo.com/21860134
@dciccale
dciccale / git_branch.sh
Created May 11, 2013 18:02
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
@adunning
adunning / gist:c670ab28c16f031f4777
Last active January 7, 2020 16:06 — forked from schmurfy/gist:3199254
Install pandoc on Mac OS X 10.9
#!/bin/bash
# First install BasicTeX: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
# Allows you to run tlmgr without sudo.
$ sudo chown -R `whoami` /usr/local/texlive
# Update everything.
$ tlmgr update --self --all
# Install extra packages used by the default pandoc template.
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
anonymous
anonymous / Maggie's favorite folder
Created April 8, 2016 21:39
Maggie's favorite folder
😻😻😻😻😻😻😻😻🔥🔥🔥🔥🔥🔥💤💤💤💤💀💀💀👺👺👺👺👹👹👽💩😹😹🔥🔥🔥😿😿😼😅😥😰😭😂😢😍😘😤😤😷👲👳👮👷💂👶👦👧😲😵😶😇😑😯😖😋😆😡😠👽💀💦💧💛💙💜💚❤️💔💗💓💕💖💞💘💋💌💍💎💎💎💎💎💎💎💎💎👤👥🎅🎄🎁🎋🎉🎊🎈🎌🔮🎥💿📀💽📼📹🔋🚿🔔🔕🔉🔊🔈🔇🔆🔅📢📣📡⏳⌛️⏰⌚️🔓🔒🔏🔐💣💸🔫🔪💊💉🚬🚪🔨🔩🔧🚽💴💴💵💵💵💷💷💷💶💶💰💰💰💰🔪🔪🔪🔪🔪🚽🚽🚽🚽🚽🚽💒🏨🏩🏥🚁🚦🚥🇷🇺🇬🇧🈯️🈳🈵🈴🈲🉐🈹🈺🈹🈶🈚️🆗🆙🆕🆒🆓🆖📶🎦📶🈁🚫🔞📵🚯🚱🚳🚷㊙️🉑㊗️🈷🈸🈂♉️♊️♋️♌️♍️♎️♏️♐️♑️♒️♓️⛎🔯💲💲💱©®™©®™❌‼️⁉️❗️❓❕❔⭕️🔝🔚🔙🔛🔜🔃🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕖🕗🕘🕙🕚💮♠️♥️♣️♦️🕡🕢🕣🕤🕥🕦✖️➕➖➗✔️☑️💯🔘🔗💮🔗➰〰〽️🔱◼️◻️◾️◽️▪️▫️🔺🔲🔳⚫️⚪️🔴🔵🔻⬜️⬛️🔶🔷🔸🔹
@kaleksandrov
kaleksandrov / global-protect.sh
Last active June 28, 2024 21:59
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
@abtris
abtris / 02-Jenkinsfile
Last active July 17, 2019 04:34
Jenkinsfile - imperative style vs declarative style
pipeline {
agent any
environment {
PACKAGE="github.com/abtris/bee"
GOPATH="/Users/abtris/go"
GOROOT="/usr/local/opt/go/libexec"
}
stages {
stage('Preparation') {
steps {