Skip to content

Instantly share code, notes, and snippets.

# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
@freewind
freewind / sed cheatsheet
Created October 21, 2015 16:21 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@freewind
freewind / Client.java
Created October 25, 2011 17:05
Simple socket server and client, to test the speed of java socket
import java.io.InputStream;
import java.net.Socket;
public class SimpleClient {
public static void main(String[] args) throws Exception {
Socket socket = new Socket("127.0.0.1", 6666);
InputStream input = socket.getInputStream();
long total = 0;
long start = System.currentTimeMillis();
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<!-- normally you wouldn't show this -->
<div id="paste" contenteditable="true"></div>
<script type="text/javascript">
{
"tables": [
{
"title": [
"Application Data Driven Events Summary: Exception Requests",
"System Name: RSA Archer GRC Version: 6.4.00200.1032",
"9/20/2018"
],
"info": {
"Application Name": "Exception Requests",
https://press.one/p/address/v?s=43db63b18a5592a3f955ef638bd8d247d7315e1e33d2b21bed8d4d91e45f8ed37518a0e7ec1ac83858dcb470311e18223dac5c8df23c698e3dda207186af54421&h=06ca22c7639b002267255305b79b5ad50b794cb561968cb3694e0d6ebeeb28e8&a=7ac6a4535e1726dd6eec4f952359dcee725017f1&f=P1&v=2
@freewind
freewind / gist:f0ad661b608c8c10fb87c8e9057ff54a
Created April 5, 2018 09:48 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
;Autohotkey script to translate some Mac shortcuts for Windows
;Use Alt key instead of control key (Alt key is at the same place of Cmd on Mac)
;On Mac all hotkeys often used are: cmd+c, cmd+v, ... -> ctrl+c, ctrl+v, ... (on PC)
;Use ScrollLock key to temporary activate / descativate the current script, in case of get some trouble
;Added some Mac specific shortcuts like Alt+Shift+Right, Alt+Shift+Left or Cmd+Shift+L
;Work only with left Alt and left Control keys
#UseHook
#InstallKeybdHook
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype
sudo apt-get install build-essential libssl-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
关掉terminal,重新打开才能使用nvm命令
FROM codenvy/ubuntu_jdk8