This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push origin master:refs/heads/test | |
#creates test branch | |
#or | |
git push origin local_branch:new_remote_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create new remote branch | |
git push origin origin:refs/heads/new_branch_name | |
# Make sure everything is updated | |
git fetch origin | |
# Check your branch has been created | |
git branch -r | |
# Track a remote branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Convert Trac DB Wiki pages to Markdown source files | |
# This script is based on http://github.com/seven1m/trac_wiki_to_github which | |
# converted all pages from a Trac DB to GitHub Wiki format (as Textile). | |
# | |
# I made two changes: | |
# - uses MarkDown format instead | |
# - uses the sqllite3-ruby gem which does not need Ruby 1.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function import_calendar( start_date, end_date, cal_name, spreadsheet, sheet_name) { | |
var sheet = spreadsheet.getSheetByName(sheet_name); | |
var cal = CalendarApp.getCalendarsByName(cal_name)[0]; | |
sheet.clear(); | |
events = cal.getEvents( start_date, end_date ); | |
irow = 2; | |
for( i in events ) { | |
evt = events[i]; | |
var date = evt.getStartTime(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# vim:set fileencoding=utf-8 sw=2 ai: | |
import sqlite3 | |
import datetime | |
import re | |
SQL = ''' | |
select | |
name, version, time, author, text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
echo "Waiting for file changes" | |
inotifywait -rq --format '%T %w %f' -e close_write "path/to/files" | |
echo "Files were changed" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#脚本文件名: tc2 | |
######################################################################################### | |
#用TC(Traffic Control)解决ADSL宽带速度技术 Ver. 1.0 by KindGeorge 2004.12.27 # | |
######################################################################################### | |
#此脚本经过实验通过,更多的信息请参阅http://lartc.org | |
#tc+iptables+HTB+SFQ | |
# | |
#一.什么是ADSL? ADSL(Asymmetric Digital Subscriber Loop,非对称数字用户环路) | |
#用最简单的话的讲,就是采用上行和下行不对等带宽的基于ATM的技术. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# USAGE: ./watchrun.sh COMMAND | |
# New credit to: http://exyr.org/2011/inotify-run/ | |
# this script will wait for changes in the current directory tree, and when one occurs, it will run COMMAND, then resume waiting | |
# requires inotify-tools: | |
# sudo apt-get install inotify-tools | |
# or: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dgram = require('dgram'); | |
var socket = dgram.createSocket('udp4'); | |
var testMessage = "[hello world] pid: " + process.pid; | |
var multicastAddress = '239.1.2.3'; | |
var multicastPort = 5554; | |
socket.bind(multicastPort, '0.0.0.0'); | |
socket.addMembership(multicastAddress); |
OlderNewer