This file contains hidden or 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 String | |
| ACCENTED_VOWELS = "áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÔÖÚÙÛÜÇ" | |
| UNACCENTED_VOWELS = "aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC" | |
| def unaccentize | |
| self.tr ACCENTED_VOWELS, UNACCENTED_VOWELS | |
| end | |
| end |
This file contains hidden or 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 'delegate' | |
| class AbandonedTrialQuery < SimpleDelegator | |
| def initialize(relation = Account.scoped) | |
| super(relation.where(plan: nil, invites_count: 0)) | |
| end | |
| end |
This file contains hidden or 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 CarouselCollection extends Backbone.Collection | |
| initialize: -> | |
| @currentIndex = 0 | |
| @step = 1 | |
| current: (value = null)-> | |
| @changeIndex @indexOf(value) if value | |
| @at @currentIndex | |
| changeIndex: (newIndex)-> |
This file contains hidden or 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
| <script> | |
| a = 'Bug' | |
| r = {z: {x: a}, z: 'Not Bug!'} | |
| if(r.z == 'Not Bug!') | |
| document.write('<style>html{background: green}</style>') | |
| else | |
| document.write('<style>html{background: red}</style>') | |
| </script> |
This file contains hidden or 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
| set t_Co=256 | |
| if has('vim_starting') | |
| set nocompatible | |
| set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
| endif | |
| call neobundle#rc(expand('~/.vim/bundle/')) | |
| NeoBundleFetch 'Shougo/neobundle.vim' |
This file contains hidden or 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
| curl -I http://whos.amung.us/widget/dtosqdqleyjj.pnh | |
| HTTP/1.1 303 See Other | |
| Date: Mon, 20 Jan 2014 11:09:18 GMT | |
| Content-Type: text/html | |
| Connection: close | |
| Location: http://widgets.amung.us/classic/05/516.png | |
| Set-Cookie: uid=CgH9JlLdA96wISIIGbwBAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=whos.amung.us; path=/ | |
This file contains hidden or 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
| <h1>Foo</h1> | |
| <h2>bar</h2> | |
| <h3>foobar</h3> | |
| <div> | |
| <h1>Foo</h1> | |
| <h2>bar</h2> | |
| <h3>foobar</h3> | |
| </div> |
This file contains hidden or 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. Two space soft indents (fake tabs) OR tabs... BUT NEVER BOTH - DO NOT MIX | |
| 2. Whitespace, Parens, Braces, Linebreaks | |
| if/else/for/while/try always have spaces, braces and multiple lines. | |
| -------------------------------------------------------------------- | |
This file contains hidden or 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
| define 'components/singleton', [], -> | |
| ### | |
| Singleton class | |
| ### | |
| class Singleton extends Backbone.View | |
| # @static | |
| @getInstance = -> | |
| @_instance = new @ unless @_instance? | |
| @_instance |
This file contains hidden or 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 "openssl" | |
| require 'digest/sha2' | |
| require 'base64' | |
| # We use the AES 256 bit cipher-block chaining symetric encryption | |
| alg = "AES-256-CBC" | |
| # We want a 256 bit key symetric key based on some passphrase | |
| digest = Digest::SHA256.new |