Imagine this case:
class Account < ActiveRecord::Base
def transfer(other, quantity)
tries = 0
begin
tries += 1
transaction do
self.quantity -= quantity
require 'octokit' | |
# https://help.github.com/articles/creating-an-access-token-for-command-line-use/ | |
client = Octokit::Client.new(:access_token => "getmefromgithub") | |
COPY_FROM_REPO = "repo/old" | |
COPY_TO_REPO = "repo/new" | |
current_labels = client.labels(COPY_FROM_REPO) |
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven | |
mvn --version |
#!/bin/bash | |
# Author: Erik Kristensen | |
# Email: erik@erikkristensen.com | |
# License: MIT | |
# Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
# Usage: ./check_docker_container.sh _container_id_ | |
# | |
# Depending on your docker configuration, root might be required. If your nrpe user has rights | |
# to talk to the docker daemon, then root is not required. This is why root privileges are not |
#define USE_ROBIN_HOOD_HASH 1 | |
#define USE_SEPARATE_HASH_ARRAY 1 | |
template<class Key, class Value> | |
class hash_table | |
{ | |
static const int INITIAL_SIZE = 256; | |
static const int LOAD_FACTOR_PERCENT = 90; | |
struct elem |
This playbook has been removed as it is now very outdated. |
Imagine this case:
class Account < ActiveRecord::Base
def transfer(other, quantity)
tries = 0
begin
tries += 1
transaction do
self.quantity -= quantity
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
package com.linkedin.dust.renderer; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import java.io.Writer; | |
import org.mozilla.javascript.Context; | |
import org.mozilla.javascript.JavaScriptException; |
=begin | |
Jekyll tag to include Markdown text from _includes directory preprocessing with Liquid. | |
Usage: | |
{% markdown <filename> %} | |
Dependency: | |
- kramdown | |
=end | |
module Jekyll | |
class MarkdownTag < Liquid::Tag | |
def initialize(tag_name, text, tokens) |
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |