by [email protected] 原始地址: pre-commit hook
1、在提交代码(git commit)到git库时,本钩子被触发。
2、调用phpcbf和phpcs,来做代码检查并尝试自动修复代码样式。
::RBNACL_LIBSODIUM_GEM_LIB_PATH = "C:/ruby22/libsodium.dll" | |
require 'discordrb' | |
require 'youtube-dl' | |
bot = Discordrb::Commands::CommandBot.new token: '<token here>', client_id: <client id here>, prefix: '|' | |
no_channel_warning = "You're not in a voice channel!" | |
bot.command :play do |event, songlink| | |
channel = event.user.voice_channel |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'eventmachine' | |
class Server | |
attr_accessor :connections | |
def initialize | |
@connections = [] |
#!/usr/bin/env ruby | |
# | |
# Chat server attempt with Ruby and EventMachine. | |
# | |
# TODO: | |
# | |
# - Prevent chat from acting on \n (pressing enters in chat) | |
# - Handle (unexpected) disconnects properly (with unbind event). | |
# - Implement proper leaving with /quit. |
source :rubygems | |
gem "eventmachine" |
#!/usr/bin/env ruby | |
# Copyright (c) 2009 Samuel Williams. Released under the GNU GPLv3. | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
#!/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'], |
# 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/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" |
by [email protected] 原始地址: pre-commit hook
1、在提交代码(git commit)到git库时,本钩子被触发。
2、调用phpcbf和phpcs,来做代码检查并尝试自动修复代码样式。
# 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! |