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
# http://docs.rubygems.org/read/chapter/11 | |
--- | |
gem: --no-ri --no-rdoc | |
benchmark: false | |
verbose: true | |
update_sources: true | |
sources: | |
- http://gems.rubyforge.org/ | |
- http://rubygems.org/ | |
backtrace: true |
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
upstream rails { | |
server unix:///var/www/CHANGE/current/tmp/sockets/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name CHANGE; | |
root /var/www/CHANGE/current/public; | |
client_max_body_size 8M; |
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 | |
# Downsamples all retina ...@2x.png images. | |
# Requires `sips` to be installed | |
echo "Downsampling retina images..." | |
dir=$(pwd) | |
find "$dir" -name "*@2x.png" | while read image; do | |
outfile=$(dirname "$image")/$(basename "$image" @2x.png).png |
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 'rmagick' | |
number_of_colors = 100 | |
file_path = "/path/to/file.jpg" | |
begin | |
temp_file = Magick::Image.read(file_path).first.quantize(number_of_colors) | |
pixels = {} | |
pixel_count = 0 | |
temp_file.each_pixel do |p,c,r| | |
pixel_count += 1 | |
pix = p.to_color(Magick::AllCompliance, false, 8) |
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
(1..100).each{|i| puts (i%3==0?'Fizz': '')+(i%5==0?'Buzz': '')+(i%3==0||i%5==0?'': i.to_s)} |
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 Example < ActiveRecord::Base | |
include WithoutTimestamps | |
def update_something | |
update_without_timestamps something: "is changed" | |
end | |
def alternatively | |
self.something = "is changed" | |
update_without_timestamps |
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
// | |
// StretchCollectionViewFlowLayout.swift | |
// | |
// Created by Andrew C on 5/8/15. | |
// | |
import UIKit | |
class StretchCollectionViewFlowLayout: UICollectionViewFlowLayout { |
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
.box-shadow { | |
width: 100px; | |
height: 100px; | |
position: absolute; | |
z-index: 100; | |
top: 10; | |
left: 10; | |
background: #fff; | |
-moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.8); /* FF3.5+ */ | |
-webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.8); /* Saf3.0+, Chrome */ |
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
SELECT | |
node.nid AS nid, | |
node_data_field_spot_permalink.field_spot_permalink_value AS node_data_field_spot_permalink_field_spot_permalink_value, | |
node.type AS node_type, | |
node.vid AS node_vid, | |
node_data_field_spot_permalink.field_spot_image_fid AS node_data_field_spot_permalink_field_spot_image_fid, | |
node_data_field_spot_permalink.field_spot_image_list AS node_data_field_spot_permalink_field_spot_image_list, | |
node_data_field_spot_permalink.field_spot_image_data AS node_data_field_spot_permalink_field_spot_image_data, | |
node.title AS node_title, | |
node_data_field_spot_permalink.field_spot_bloggname_value AS node_data_field_spot_permalink_field_spot_bloggname_value, |
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
# Directory listing | |
alias ls="ls -G" | |
alias l="ls" | |
alias ll='ls -Ghlk' | |
alias la='ls -GAhlka' | |
alias ..="cd .." | |
alias G=" | grep " | |
# Convenience commands | |
alias flushdns="dscacheutil -flushcache" |
OlderNewer