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
Bigrams | |
======= | |
<% 36660 | |
%> 36660 | |
", 32607 | |
-- 28212 | |
</ 27362 | |
## 23585 | |
=" 20999 | |
== 20323 |
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
.spoiler, .spoiler *, .spoiler:after { | |
-webkit-transition: all 0.2s ease-in-out; | |
-moz-transition: all 0.2s ease-in-out; | |
-o-transition: all 0.2s ease-in-out; | |
-ms-transition: all 0.2s ease-in-out; | |
transition: all 0.2s ease-in-out; | |
} | |
.spoiler { | |
border: 1px solid transparent; |
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 MyModel < ActiveRecord::Base | |
def foo=(foo) | |
if foo == "thing" | |
self.bar = "a thing was found" | |
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
class List | |
def initialize | |
@list = Hash.new(0) | |
end | |
def add_item(item) | |
@list[item] += 1 | |
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
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
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
$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
# 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
class Numeric | |
def percent | |
self.to_f / 100.0 | |
end | |
end | |
class Float | |
def chance? | |
rand < self | |
end |
NewerOlder