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
es: | |
admin: | |
js: | |
true: Cierto | |
false: Falso | |
is_present: Está presente | |
is_blank: Está en blanco | |
date: Fecha ... | |
between_and_: Entre ... y ... | |
today: Hoy |
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 DS from 'ember-data'; | |
export default DS.RESTAdapter.extend({ | |
host: 'http://dummy.restapiexample.com/api/v1' | |
}); |
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
function convertTimestamp(timestamp) { | |
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
yyyy = d.getFullYear(), | |
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
hh = d.getHours(), | |
h = hh, | |
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
ampm = 'AM', | |
time; |
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 'open-uri' | |
require 'nokogiri' | |
# set the document's url | |
my_post_uri = "https://blog.heroku.com/archives/2014/9/23/introducing-heroku-dx" | |
# get the document to parse | |
document = Nokogiri::HTML(open(my_post_uri), nil, 'UTF-8') | |
# parse the element | |
post_body = document.at_css("div.post_body") |
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
<script type="text/javascript" src="jquery-1.10.2.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#image").change(function(){ | |
var file = document.getElementById("image").files[0]; |
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 'time' | |
Date_of_birth = '1988-8-31' | |
# Credit to : http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails | |
# and modified a little bit | |
def humanize secs | |
[ | |
[60, :seconds], | |
[60, :minutes], |
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
for f in `find . -regex '.*\.html\.erb'`; do echo "Converting $f" && html2haml $f > "${f%.erb}.haml" && rm $f; done |
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
TRUNCATE table1, table2, table3 RESTART IDENTITY; |
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
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
development: | |
adapter: mysql | |
database: database_development | |
user: root | |
password: | |
socket: /tmp/mysql.sock | |
pool: 5 | |
timeout: 5000 |
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
--- | |
:verbose: true | |
:bulk_threshold: 1000 | |
:benchmark: false | |
:sources: | |
- http://rubygems.org/ | |
- http://gems.github.com | |
gem: --no-ri --no-rdoc | |
:update_sources: true | |
:backtrace: false |