Skip to content

Instantly share code, notes, and snippets.

@fortuity
fortuity / gist:468417
Created July 8, 2010 18:46
Options for "rails generate scaffold"
$ rails generate scaffold BusinessEntry content:string --no-stylesheets --no-fixture --no-test-framework --no-helper --pretend
invoke mongoid
create app/models/business_entry.rb
route resources :business_entries
invoke scaffold_controller
create app/controllers/business_entries_controller.rb
invoke haml
create app/views/business_entries
create app/views/business_entries/index.html.haml
create app/views/business_entries/edit.html.haml
# filename: config/locales/pl.rb
# taken from: http://github.com/svenfuchs/i18n/blob/4d8e2e3b8ce9841542cc3cf4d33b7a7702b2abc1/test/test_data/locales/plurals.rb
{:pl => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) && ![22, 23, 24].include?(n % 100) ? :few : :other } } } } }
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@awinograd
awinograd / gist:4699980
Last active January 30, 2018 22:54
cvim file for opening links from better_error and RailsPanel in vim on ubuntu.
#! /usr/bin/env ruby
# Modified from : http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu
# NOTE: This opens with a link to the mvim protocol for compatibility with RailsPanel
# goes to /usr/local/bin/cvim
require 'uri'
require 'cgi'
full_path = ARGV[0]
@InSuperposition
InSuperposition / SassMeister-input.scss
Created February 4, 2014 16:47
VideoJS default styles in Sass.
// ----
// Sass (v3.2.14)
// Compass (v0.12.2)
// ----
/*!
Video.js Default Styles (http://videojs.com)
Version GENERATED_AT_BUILD
Create your own skin at http://designer.videojs.com
*/
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@CucumisSativus
CucumisSativus / Capfile
Last active April 26, 2020 14:09
Mydevil capistrano
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'
require "whenever/capistrano"
# Load custom tasks from `lib/capistrano/tasks' if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
{
"dependencies":{
"main.js":{
"files":[
"scripts/main.js"
],
"main":true
},
"main.css":{
"files":[
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@Rich-Harris
Rich-Harris / README.md
Last active January 25, 2023 19:03
Unifying Rollup options

Rollup 0.48 introduces a few changes to the options object, because the current options are confusingly different between the CLI and the options exported by your config file.

Changes to the config file

  • entry is now input
  • sourceMap and sourceMapFile are now sourcemap and sourcemapFile (note casing)
  • moduleName is now name
  • useStrict is now strict

The dest and format options are now grouped together as a single output: { file, format, ... } object. output can also be an array of { file, format, ... } objects, in which case it behaves similarly to the current targets. Other output options — exports, paths and so on — can be added to the output object (though they will fall back to their top-level namesakes, if unspecified).