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 BottomlessHash < Hash | |
def initialize | |
super &-> h, k { h[k] = self.class.new } | |
end | |
def self.from_hash(hash) | |
new.merge(hash) | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0.sublime"> | |
<dict> | |
<key>name</key> | |
<string>Railscasts</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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
# global $ | |
React = require('react') | |
class Drawer extends React.Component | |
@defaultProps: -> | |
payload: null, | |
drawerOpened: false | |
notFound: -> |
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
import React, { Component } from 'react'; | |
class Drawer extends Component { | |
getDefaultProps() { | |
return { | |
payload: null, | |
drawerOpened: false | |
}; | |
}; |
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
months: | |
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | |
render: -> | |
DOM.select | |
onChange: @onMonthChange | |
value: @props.date.getMonth() | |
DOM.option( | |
value: i, key: i, @months[i] | |
) for i in [0..(@months.length-1)] |
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 'paleta' | |
colors = %w( 669900 66FF00 66CCFF 6699FF 6633FF ) | |
to_color = ->(color) { Paleta::Color.new(:hex, color) } | |
to_div = ->(color) { "<div style='width: 3em; height: 3em; background: ##{color}; float: left'></div>" } | |
puts colors.uniq.map(& to_color).sort_by(&:hue).map(&:hex).map(& to_div) |
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
module.exports = (grunt) -> | |
# configuration | |
grunt.initConfig | |
# grunt sass | |
sass: | |
compile: | |
options: | |
style: 'expanded' |
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 @Equalizer | |
constructor: (selector) -> | |
@init $(selector) | |
init: ($collection)-> | |
@attachTo($collection) if $collection.length | |
attachTo: ($collection) -> | |
@collection = $collection | |
@setTimeoutFunction(@equalizeHeight, @collection) |
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 Page | |
has_many :blocks, -> { ordered }, dependent: :destroy | |
attr_accessors :title | |
def visible_blocks | |
@visible_block ||= blocks.current_locale.map(&:blockable) | |
end | |
end | |
class Block |
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 TestCyrillic | |
class << self | |
def cyrillic?(string) | |
string[/\p{Cyrillic}/] | |
end | |
end | |
end | |
class String | |
def cyrillic? |