by [email protected] 原始地址: pre-commit hook
1、在提交代码(git commit)到git库时,本钩子被触发。
2、调用phpcbf和phpcs,来做代码检查并尝试自动修复代码样式。
class String | |
def mv_up(n=1) | |
cursor(self, "\033[#{n}A") | |
end | |
def mv_down(n=1) | |
cursor(self, "\033[#{n}B") | |
end | |
def mv_fw(n=1) |
source "https://rubygems.org" | |
gem 'pry' | |
# gem "ascii-image" | |
gem "rmagick", "=2.13.1" | |
gem "rainbow", "= 1.1.4" | |
gem "pry-rescue" | |
gem "paint" |
require 'rubygems' | |
require 'eventmachine' | |
module Telnet | |
# :stopdoc: | |
IAC = 255.chr # "\377" # "\xff" # interpret as command | |
DONT = 254.chr # "\376" # "\xfe" # you are not to use option | |
DO = 253.chr # "\375" # "\xfd" # please, you use option | |
WONT = 252.chr # "\374" # "\xfc" # I won't use option | |
WILL = 251.chr # "\373" # "\xfb" # I will use option |
# | |
# | |
# Compile & execute Ruby as bytecode | |
# | |
# | |
require 'rbconfig' | |
require 'dl' | |
require 'fiddle' | |
require 'strscan' |
# This is a comment | |
# In Ruby, (almost) everything is an object. | |
# This includes numbers... | |
3.class #=> Integer | |
# ...and strings... | |
"Hello".class #=> String | |
# ...and even methods! |
by [email protected] 原始地址: pre-commit hook
1、在提交代码(git commit)到git库时,本钩子被触发。
2、调用phpcbf和phpcs,来做代码检查并尝试自动修复代码样式。
#!/usr/bin/env ruby | |
# REF => https://gist.github.com/karmi/442106#file-post-receive-deploy-rb-L21 | |
################################################### | |
# === CONFIGURE THE SCRIPT HERE ================= # | |
deploy_branch = 'master' #=> change to production | |
git_path = Dir.pwd | |
application_path = File.dirname(git_path) + "/current" |
# coding: binary | |
# IRC <-> Campfire bridge, set IRC password to SUBDOMAIN:TOKEN and connect to localhost:6667 | |
# Remove special chars/spaces from channel names (ie "Foo Bar" becomes #FooBar). Only tested with LimeChat. | |
# gem install excon && gem install yajl-ruby -v "< 2.0" | |
%w[socket thread uri excon yajl yajl/http_stream].each { |lib| require lib } | |
Thread.abort_on_exception = true | |
[:INT, :TERM].each { |sig| trap(sig) { exit } } | |
server = TCPServer.new('127.0.0.1', 6667) | |
loop do |
#!/usr/local/bin/ruby | |
require 'net/ssh' | |
require 'optparse' | |
ASTERISK_RX = '/usr/sbin/asterisk -rx ' | |
@rand = Random.rand(1..3) | |
@user = {1 => ['270','cell phone number goes here'], | |
2 => ['182','cell phone number goes here'], |