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
# C:\Users\rober\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup | |
liquidctl initialize all | |
liquidctl --match kraken set pump speed 90 | |
liquidctl --match kraken set fan speed 20 30 30 50 32 65 34 100 | |
liquidctl --match Smart set sync color breathing 000080 | |
liquidctl --match Smart set sync speed 50 |
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
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
internal; | |
if ($http_accept ~ json) { | |
return 503 "{}"; | |
} |
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
module A | |
def self.included(target) | |
v = target.instance_methods.include?(:method_name) | |
puts "in included: #{v}" | |
end | |
def self.append_features(target) | |
v = target.instance_methods.include?(:method_name) | |
puts "in append features before: #{v}" | |
super |
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
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)' | |
task :test do | |
errors = %w(test:units test:functionals test:integration).collect do |task| | |
begin | |
Rake::Task[task].invoke | |
nil | |
rescue => e | |
task | |
end | |
end.compact |
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
namespace :db do | |
def local_database?(config, &block) | |
if config['host'].in?(['127.0.0.1', 'localhost', '192.168.30.1']) || config['host'].blank? | |
yield | |
else | |
$stderr.puts "This task only modifies local databases. #{config['database']} is on a remote host." | |
end | |
end | |
end |
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
class MyCommandHandler | |
def initialize | |
make_threadsafe_by_stateless | |
end | |
def call(cmd) | |
local_var = cmd.something | |
output(local_var) | |
end |
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
require 'pry' | |
require 'parser' | |
require 'parser/current' | |
class ConstToMethodRewriter < ::Parser::Rewriter | |
def on_casgn(node) | |
_, const_name, *args = node.children | |
replace_range = node.location.expression | |
const_value = args.first.location.expression.source |
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
~/d/project (feature/delayed_job_pool|✚3…) $ cat tmp/pids/delayed_job.0.pid | |
14702 | |
~/d/project (feature/delayed_job_pool|✚3…) $ cat tmp/pids/delayed_job.1.pid | |
14704 | |
~/d/project (feature/delayed_job_pool|✚3…) $ ps aux | grep delayed | |
rupert 14702 72.9 2.9 4865820 481384 ?? R 9:43AM 3:25.55 delayed_job.0 | |
rupert 14704 0.0 2.8 4839192 467044 ?? S 9:43AM 3:26.31 delayed_job.1 | |
rupert 15205 0.0 0.0 4267752 360 s005 R+ 10:18AM 0:00.00 grep --color=auto delayed | |
~/d/project (feature/delayed_job_pool|✚3…) $ kill -9 14702 |
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
require 'action_view' | |
require 'tmpdir' | |
require 'fileutils' | |
require 'optparse' | |
def check_syntax(path, options = {}) | |
erb = content(path) | |
code = ruby_code(erb) | |
eval("BEGIN { puts('ok'); return true }; #{code}", nil, path, 0) |
NewerOlder