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
/* gnome-terminal */ | |
TerminalScreen { | |
-TerminalScreen-background-darkness: 0.95; | |
background-color: #300a24; | |
color: #fff; | |
} | |
TerminalWindow, | |
TerminalWindow.background { | |
background-image: none; |
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 LocaleController < ApplicationController | |
respond_to :json | |
caches_page :show, :gzip => :best_compression | |
def show | |
expires_in 1.year | |
respond_with YAML::load File.open File.join Rails.root, %W[config locales #{params[:id]}.yml] | |
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 FooBarController < ApplicationController | |
## | |
##This unscoping works: | |
def index | |
Campaign.unscoped do | |
Advertiser.unscoped do | |
@invoices = Invoice.all :include => [:campaign, :advertiser] | |
end | |
end | |
respond_to do |format| |
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 -e | |
# | |
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to | |
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls | |
# to the service and redirect them to unicorn directly. | |
# | |
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn. | |
# | |
function is_unicorn_alive { |
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 Acme | |
attr_accessor :a, :b | |
def initialize | |
@a=[] | |
@b=[] | |
end | |
def foo! | |
a<<5 | |
self |
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
#!/usr/bin/env ruby | |
require 'csv' | |
require 'ipaddr' | |
# Formating: | |
ff = ->() { | |
f = ->(a) {a.take(2).map(&IPAddr.method(:new)).map(&:to_i) rescue a.take(2).map(&:to_i) } | |
f[CSV.parse(self.peek).first] | |
} |
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
alias subl="/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe" | |
if [[ ! -z $SSH_AGENT_PID ]] && `kill -0 $SSH_AGENT_PID` && [[ -f $SSH_AUTH_SOCK ]] | |
then | |
echo -e "\e[33m ☀ SSH agent already set up!" | |
else | |
eval `ssh-agent.exe` | |
ssh-add ~/.ssh/id_rsa | |
conemuc //EXPORT SSH_AUTH_SOCK SSH_AGENT_PID | |
fi |
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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<!-- | |
/* | |
** Copyright 2006, The Android Open Source Project | |
** | |
** Licensed under the Apache License, Version 2.0 (the "License"); | |
** you may not use this file except in compliance with the License. | |
** You may obtain a copy of the License at | |
** | |
** http://www.apache.org/licenses/LICENSE-2.0 |
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
def check | |
yield | |
rescue => e | |
e | |
end | |
check { "hello, #{1}" } # ? | |
check { "hello, " + 1 } # ? | |
check { "hello, " << 1 } # ? |
OlderNewer