把一个git仓库的origin搬到另一台服务器上
-
在旧服务器上删除这个仓库
rm -r /home/$USER/repo/$REPO
-
在新服务器上创建一个同名的仓库
cd /home/$USER/repo git init --bare $REPO
#include <stdio.h> | |
#include <termios.h> | |
int getch(void) { | |
int ch; | |
struct termios oldt; | |
struct termios newt; | |
tcgetattr(STDIN_FILENO, &oldt); /*store old settings */ | |
newt = oldt; /* copy old settings to new settings */ |
#include <iostream> | |
#include <limits> | |
template <typename T> | |
void test_limits() { | |
T min = std::numeric_limits<T>::min(); | |
T max = std::numeric_limits<T>::max(); | |
std::cout << "min: " << min << std::endl; | |
std::cout << "max: " << max << std::endl; | |
} |
Erlang references are unique indentifiers. They are commonly used to | |
identify timers, rpc calls, etc. | |
make_ref() -> ref() | |
Returns an almost unique reference. | |
The returned reference will re-occur after approximately 2^82 calls; |
import std.stdio; | |
long factorial(int n) { | |
long fac = 1; | |
foreach (i; 1..n+1) { | |
fac *= i; | |
} | |
return fac; | |
} |
x=1;1.upto(gets.to_i){|i|x*=i};p x |
把一个git仓库的origin搬到另一台服务器上
在旧服务器上删除这个仓库
rm -r /home/$USER/repo/$REPO
在新服务器上创建一个同名的仓库
cd /home/$USER/repo git init --bare $REPO
#!/bin/bash | |
set -e | |
PREFIX="$HOME/local/ruby/1.9.3" | |
RUBY_DIST_URL="ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz" | |
RUBY_DIST_PKG=`basename $RUBY_DIST_URL` | |
RUBY_DIST_DIR=`basename $RUBY_DIST_PKG .tar.gz` |
#!/bin/bash | |
script_dir() | |
{ | |
local SCRIPT_PATH=${BASH_SOURCE[0]} | |
while [ -L "${SCRIPT_PATH}" ]; do | |
SCRIPT_PATH=`readlink "$SCRIPT_PATH"` | |
done | |
local SCRIPT_DIR=`dirname "${SCRIPT_PATH}"` |
def parse_config_stream(str_or_file): | |
_myglobals, mylocals = {}, {} | |
exec str_or_file in _myglobals, mylocals | |
return mylocals | |
def parse_config_file(filename): | |
_myglobals, mylocals = {}, {} | |
with open(filename) as f: | |
exec f in _myglobals, mylocals |
$ gem sources | |
*** CURRENT SOURCES *** | |
http://rubygems.org/ | |
http://gems.github.com/ | |
$ gem sources --remove http://rubygems.org/ | |
http://rubygems.org/ removed from sources | |
$ gem sources --add http://ruby.taobao.org/ |