Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View inetfuture's full-sized avatar
💭
I may be slow to respond.

Aaron Wang inetfuture

💭
I may be slow to respond.
  • 上海群之脉信息科技有限公司
  • 山东潍坊
View GitHub Profile
@inetfuture
inetfuture / Employee.java
Created August 1, 2016 13:41
clean-functions-examples
class Employee {
public Money calculatePay() {
switch (this.type) {
case COMMISSIONED:
return this.calculateCommissionedPay();
case HOURLY:
return this.calculateHourlyPay();
case SALARIED:
return this.calculateSalariedPay();
default:
time ( s=192.168.225 ; for i in $(seq 1 254) ; do ( ping -n -c 1 -w 1 $s.$i 1>/dev/null 2>&1 && printf "%-16s %s\n" $s.$i responded ) & done ; wait ; echo )
<!-- Add this to YOUR_THEME.tmTheme, based on https://gist.github.com/CrazyApi/2354062 -->
<!-- For Markdown -->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
import subprocess
def execute(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = ''
# Poll process for new output until finished
for line in iter(process.stdout.readline, ""):
print line,
output += line
#! /bin/bash
cd /proc
for pid in [0-9]*; do
command=$(cat /proc/$pid/cmdline)
swap=$(
awk '
BEGIN { total = 0 }
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
#!/usr/bin/env python
LOG_FILENAME = '/var/log/git-hook-post-receive.log'
from datetime import datetime
if __name__ == '__main__':
try:
from sys import stdin
prev_sha, new_sha, ref = stdin.readline().split()
CWD=`cd $(dirname $0);pwd`
cd $CWD;