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
#!/bin/bash | |
INTERVAL=5 | |
REBOOT_BORDER=10 | |
MAILTO="[email protected]" | |
LOG_DIR="/var/log/loadavg" | |
mkdir -p $LOG_DIR | |
while : | |
do | |
LOAD_AVG=$( uptime | awk '{print $10}' | cut -d "." -f 1 ) |
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
options = @options.dup | |
options['skip_bundle'] = true | |
@options = options | |
gsub_file 'Gemfile', 'jquery-rails', 'bower-rails' | |
file 'Bowerfile', <<-CODE | |
asset 'jquery' | |
asset 'jquery-ujs' | |
asset 'bootstrap', '>= 3.0.0' | |
CODE |
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 'backup' | |
namespace :backup do | |
desc "Backup database." | |
task :db => ['db:load_config'] do | |
config = ActiveRecord::Base.configurations[Rails.env] | |
Backup::Model.new(:rake, 'backup') do | |
store_with Backup::Storage::Local do |local| | |
local.keep = 5 | |
local.path = Rails.root.join('backups') | |
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
var lastSheet = document.styleSheets[document.styleSheets.length - 1]; | |
if(lastSheet){ | |
lastSheet.insertRule("@-webkit-keyframes blink { from { opacity: 1.0; } to { opacity: 0.6; } }", lastSheet.cssRules.length); | |
} | |
var blink = {webkitAnimationName: 'blink', | |
webkitAnimationDuration: '1s', | |
webkitAnimationIterationCount: 'infinite', | |
webkitAnimationTimingFunction: 'ease-in-out'}; | |
$("#node").css(blink); |
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 'kramdown' | |
require 'uri' | |
require 'pathname' | |
body =<<EOS | |
> [link](test) | |
>> [google](http://www.google.com) | |
EOS | |
kramdown = Kramdown::Document.new(body) |
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
(set-face-foreground 'font-lock-comment-face "#ff6666") ;red | |
(set-face-foreground 'font-lock-string-face "#66ff66") ;green | |
(set-face-foreground 'font-lock-keyword-face "cyan") | |
(set-face-bold-p 'font-lock-keyword-face t) | |
(set-face-foreground 'font-lock-function-name-face "#6699ff") ;blue | |
(set-face-bold-p 'font-lock-function-name-face t) | |
(set-face-foreground 'font-lock-variable-name-face "#ffd314") ;yellow | |
(set-face-foreground 'font-lock-type-face "#66ff66") ;green | |
(set-face-foreground 'font-lock-builtin-face "purple") | |
(set-face-foreground 'font-lock-constant-face "purple") |
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
# Ubuntu upstart file at /etc/init/mongos.conf | |
start on runlevel [2345] | |
stop on runlevel [06] | |
script | |
ENABLE_MONGODB="yes" | |
PIDFILE=/var/run/mongos.pid | |
if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --start --quiet --chuid mongodb -m --pidfile $PIDFILE --exec /usr/bin/mongos -- --config /etc/mongos.conf; fi | |
end script |
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
# Ubuntu upstart file at /etc/init/mongoc.conf | |
pre-start script | |
mkdir -p /var/lib/mongoc/ | |
chown mongodb:mongodb /var/lib/mongoc/ | |
end script | |
start on runlevel [2345] | |
stop on runlevel [06] |
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
(eval-when-compile (require 'cl)) | |
(require 'vc-bzr) | |
(provide 'anything-bzr-grep) | |
(defvar anything-c-source-bzr-grep-cache nil "path") | |
(setq bzr-command "/usr/local/bin/bzr") | |
(defun anything-bzr-grep-init () | |
(setq anything-c-source-bzr-grep-cache | |
(vc-bzr-root (if (buffer-file-name) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>QR Code Generator</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="https://raw.github.com/jeromeetienne/jquery-qrcode/master/jquery.qrcode.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
$("#button").on('click', function(){ |