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
color 1: #E29C17 | |
color 2: #009914 | |
color 1 in decimal: rgb(226, 156, 23) | |
color 2 in decimal: rgb(0, 153, 20) | |
colors blended: | |
rgb((226+0)/2, (156+153)/2, (23+20)/2) | |
= rgb(113, 154.5, 21.5) |
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
tell application "System Events" | |
set theProcess to "something" | |
if (get name of processes contains theProcess) then | |
if (get visible of process theProcess) then | |
set visible of process theProcess to false | |
else | |
set visible of process theProcess to true | |
activate application theProcess | |
end if | |
else |
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 | |
# Usage: | |
# | |
# Create a list of installed gems: | |
# $ gem list > my_gems.txt | |
# | |
# Copy my_gems.txt to your target and pipe it through this script: | |
# $ cat my_gems.txt | ./install_gems.rb |
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
// General rich textarea | |
function jRichTextArea(textArea, options) { | |
this.textArea = textArea; | |
// Default options | |
settings = jQuery.extend({ | |
className: "richTextToolbar" | |
}, options); | |
this.toolbar = { |
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 Numeric | |
def percent | |
self.to_f / 100.0 | |
end | |
end | |
class Float | |
def chance? | |
rand < self | |
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
# Model | |
class Foo < ActiveRecord::Base | |
class << self | |
def fetch_bar(bar) | |
self.create({ | |
:bar => open("http://bar.com/#{bar}").read | |
}) | |
end | |
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
$font-size: 16; | |
$line-height: $font-size * 1.5; | |
$column-width: 60; | |
$gutter-width: 16; | |
$rem: $font-size / 1rem; | |
@mixin font-size($size: $font-size) { | |
font-size: $size + px; | |
font-size: $size / $rem; | |
} |
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
default_run_options[:pty] = true | |
# Name of application | |
set :application, "yourapp" | |
# Your username on the server | |
set :user, "app" | |
set :runner, user | |
# Use sudo? |
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
boolean output = true; | |
int frameNumber = 0; | |
void setup() { | |
smooth(); | |
size(1280, 720, P3D); | |
fill(0); | |
} | |
void draw() { |
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 List | |
def initialize | |
@list = Hash.new(0) | |
end | |
def add_item(item) | |
@list[item] += 1 | |
end | |
end |
OlderNewer