$ timedatectl list-timezones
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
on run {input, parameters} | |
set paths to "" | |
repeat with i from 1 to length of input | |
set cur to item i of input | |
set paths to paths & " " & quote & POSIX path of cur & quote | |
end repeat | |
set cmd to "vim -p" & paths | |
tell application "iTerm" | |
set created to false | |
if not (exists current window) then |
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
# Return a named route to current url requested | |
def route_name | |
Rails.application.routes.router.recognize(request) do |route, _| | |
return route.name.to_sym | |
end | |
end |
const race = (milliseconds, ...promises) => {
const timeout = new Promise((resolve, reject) => {
setTimeout(() => reject(`Limit operation excedded (limit: ${milliseconds} ms)`), milliseconds)
})
return Promise.race([timeout, ...promises])
}
$ rails new APP_NAME -d postgresql --skip-action-mailbox --skip-action-text --skip-spring --webpack=react -T --skip-turbolinks
# config/application.rb
config.generators do |g|
g.test_framework false
g.stylesheets 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
if (!Date.prototype.toDatetimeLocal) { | |
(function () { | |
Date.prototype.toDatetimeLocal = function () { | |
var date = this | |
var ten = function (i) { | |
return (i < 10 ? '0' : '') + i; | |
} | |
if (date == 'Invalid Date') return false |
for file in app/views/**/*.erb; do html2haml -e $file ${file%erb}haml && rm $file; done