Skip to content

Instantly share code, notes, and snippets.

@izaac
izaac / wsl2-network.ps1
Created June 13, 2021 04:13 — forked from daehahn/wsl2-network.ps1
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@izaac
izaac / noop
Created January 26, 2021 23:22
#!/bin/bash
@izaac
izaac / Jenkinsfile.groovy
Created October 22, 2019 20:39 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@izaac
izaac / Update remote repo
Created June 15, 2019 15:20 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@izaac
izaac / Capybara.md
Created January 22, 2018 16:49 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
### Keybase proof
I hereby claim:
* I am izaac on github.
* I am izaacz (https://keybase.io/izaacz) on keybase.
* I have a public key ASAQdvc3uKh_77jJIaODMbvsLGKri5wBeWyBX5oj8OzBswo
To claim this, I am signing this object:
require "selenium-webdriver"
saucelabs_username = "zfilipin"
saucelabs_key = "" # secret
name = "firefox"
version = "36.0"
platform = "Linux"
caps = Selenium::WebDriver::Remote::Capabilities.send(name)
@izaac
izaac / jdk_download.sh
Created March 8, 2016 15:18 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@izaac
izaac / stats.js
Last active January 21, 2019 03:14
An example statistics library in Javascript.
#!/usr/bin/env node
/* jshint node: true */
'use strict';
var program = require('commander');
function add(a, b){
return a + b;
}
function numericSort(a,b) {
@izaac
izaac / sqlplay.js
Last active December 24, 2015 04:33
var Sequelize = require('sequelize');
var sequelize = new Sequelize('test1', 'user', 'passwd', {
// seems that user and passwd are ignored because we're using sqlite:
host: 'localhost',
dialect: 'sqlite',
pool: {
max: 5,
min: 0,