Skip to content

Instantly share code, notes, and snippets.

View alanhg's full-sized avatar
⌨️
Focusing

Alan.He alanhg

⌨️
Focusing
View GitHub Profile
@squarism
squarism / iterm2.md
Last active April 23, 2024 11:45
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@sydcanem
sydcanem / Nginx gzip.conf
Last active March 3, 2024 18:27
Gzip configuration for Nginx
#Enable Gzip compressed.
gzip on;
# Enable compression both for HTTP/1.0 and HTTP/1.1.
gzip_http_version 1.1;
# Compression level (1-9).
# 5 is a perfect compromise between size and cpu usage, offering about
# 75% reduction for most ascii files (almost identical to level 9).
gzip_comp_level 5;
@kevincennis
kevincennis / v8.md
Last active March 2, 2024 21:50
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@sbiffi
sbiffi / putty.bat
Last active March 22, 2024 13:23
The aim of this vbs script is to launch putty using an URL like ssh://login@host directly from a browser. The .bat is almost the same than .vbs but less robust and just their for older systems.
:: This version is not as powerfull as vbs version, please prefere the other one.
:: It's just there if you need a non-visual basic way to perform this.
:: Restrictions:
:: - Password cannot contain a % or finish with @
:: - Chrome adds a / at the end of the URL, not yet managed
:: The aim of this script is to execute putty with parameters like ssh://login@host
:: Installation:
:: - Launch putty.reg to associate ssh:// and telnet:// to this script
:: - Edit the putty path in parameter below like puttyPath="C:\Program Files (x86)\putty.exe"
@p120ph37
p120ph37 / dualfactor_anyconnect.md
Last active September 29, 2022 03:39
How to connect to a Cisco AnyConnect VPN server from the OSX (or Linux) command-line without using the AnyConnect client. Specifically, one which uses VeriSign/Symantec VIP Access dual-factor tokens.

(For Linux users, make sure you have oathtool and openconnect, then start from Step 6. If you don't have a token secret key, have a friend generate one for you on OSX via steps 3-5)

Step 1

Get homebrew and install oath-toolkit, openconnect, and tuntap.
And follow the additional tuntap installation instructions!

Step 2

After the tuntap module is installed, reboot or use kextload to activate it.

@arnobroekhof
arnobroekhof / pre-commit
Last active May 9, 2022 13:41
Maven pre commit hook
#!/bin/bash
# save the file as <git_directory>/.git/hooks/pre-commit
echo "Running Maven clean test for errors"
# retrieving current working directory
CWD=`pwd`
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# go to main project dir
cd $MAIN_DIR/../../
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active April 23, 2024 02:53
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@a1o1
a1o1 / SwingFXWebView.java
Created February 21, 2012 15:24 — forked from anjackson/SwingFXWebView.java
Embedding a JavaFX WebView in a Swing panel.
import com.sun.javafx.application.PlatformImpl;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
import javafx.scene.Node;