The following is a quick reference to exact order of hook execution in RSpec. The output from hook_spec.rb
is:
describe: "a thing"
-> before: all (top)
-> around: before (top)
-> before: each (top)
-> example: "success" (top)
/* ==UserStyle== | |
@name GitHub Dark Diff Color Customizer (customized) | |
@namespace StylishThemes | |
@version 2.0.4-custom | |
@description A diff color customization style, colorblind friendly by default | |
@author StylishThemes and contributors | |
@homepageURL https://github.com/StylishThemes/Feature-Override-Styles/ | |
@supportURL https://github.com/StylishThemes/Feature-Override-Styles/issues/new/choose | |
@updateURL https://gist.githubusercontent.com/jimeh/57b7e6e6e0107036c167f10f87a55861/raw/github-dark-diff-color-customizer.css | |
@license MIT |
----------------------------------------- | |
-- Show and Hide <application> | |
----------------------------------------- | |
-- | |
-- This script allows you to easily | |
-- toggle the visibility of a specific | |
-- app, similar to how Twitter and | |
-- Sparrow toggle with their global | |
-- hotkey option. | |
-- |
for (var i=0; i < 100000; i++) { | |
db.mass_insert.save({ | |
"first_name": "James", | |
"middle_name": "Richard", | |
"last_name": "Windsgate", | |
"email": "jamesrichardwindsgate@email.com" | |
}); | |
}; |
function bluetooth(power) | |
print("Setting bluetooth to " .. power) | |
result = hs.execute("blueutil --power " .. power) | |
if result.rc ~= 0 then | |
print("Unexpected result executing `blueutil`: rc=" .. result.rc .. " type=" .. result.type .. " output=" .. result.output) | |
end | |
end | |
function f(event) |
# A simple Ruby method which checks if the current script | |
# is running as root, and if not, re-invokes itself by | |
# using the sudo command. | |
def sudome | |
if ENV["USER"] != "root" | |
exec("sudo #{ENV['_']} #{ARGV.join(' ')}") | |
end | |
end |
This is a semi-quick key/value store I put together for a quick way to store temporary data related to what's in my database, in a reliable way. For example, I'm using it to keep track of where a hourly and a daily crontask that processes statistics left off, so it can resume only processing and summarizing new data on the next run.
Code quality most likely is not great, but it works. And I will update this gist as I update my project.
The settings table has two columns, a key
and a value
column. The value
column is serialized, so you can technically store almost anything in there. Memcache is also used as a caching layer to minimize database calls.
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.rabbitmq.rabbitmq-server</string> | |
<key>Program</key> | |
<string>/usr/local/sbin/rabbitmq-server</string> |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: p2pool | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: p2pool startup script | |
# Description: p2pool startup script | |
### END INIT INFO |
AllCops: | |
TargetRubyVersion: 2.4 |