Skip to content

Instantly share code, notes, and snippets.

var savefy = function() {
//grab all the script files in your browser with type "text/template", stored as an array
var templates = document.querySelectorAll('script[type="text/template"]');
//iterate through each template
_.each(templates, function(template) {
if (template.id) {
//grab the id of the template and store as a handlebars filename
var filename = (template.id + '.hbs').toString();
//store the contents of the template....
@tarun-pacifica
tarun-pacifica / p1.md
Last active August 29, 2015 14:07
Project 1
  • Always add methods to validate the presence of password, username, email;
	validates :username, presence: true, uniqueness: true, length: {minimum: 3}
	validates :email, presence:true
    validates :password_digest, presence:true, length; {minimum: 8}
  • When I register, if I have to sign in separately. This is a poor UX for the User. You should allow the user to log in automatically when they register as a user:
<!--userscontroller.rb-->
 def create
@tarun-pacifica
tarun-pacifica / checkout.js
Created October 10, 2014 03:47
Stripe_Checkout.js
if (typeof JSON !== "object") {
JSON = {}
}(function() {
"use strict";
function f(n) {
return n < 10 ? "0" + n : n
}
if (typeof Date.prototype.toJSON !== "function") {
Date.prototype.toJSON = function() {
@tarun-pacifica
tarun-pacifica / reroku.md
Last active September 24, 2016 02:20
Rails & Heroku

Deploying to Heroku using Rails

###Downloads

  • Begin by downloading and installing The Heroku Toolkit via [MacOSX] or [Ubuntu]. (If you havent done so already) (The Toolkit includes Heroku Command Line utility, as well as git and Foreman.)

  • Install the Bundler gem for Ruby. ( Learn about [Bundler] )

$ gem install bundler
@tarun-pacifica
tarun-pacifica / heroku.md
Last active August 29, 2015 14:06
Heroku Configuration

Deploying to Heroku using Sinatra

###Downloads

  • Begin by downloading and installing The Heroku Toolkit via [MacOSX] or [Ubuntu]. (The Toolkit includes Heroku Command Line utility, as well as git and Foreman.)

  • Install the Bundler gem for Ruby. ( Learn about [Bundler] )

$ gem install bundler
@tarun-pacifica
tarun-pacifica / terminalwindow
Created September 24, 2014 23:57
Using Command Line, start with the same Terminal directory as previous Session
1. Open preferences in iTerm.
2. Click on 'Profiles'.
3. On the right hand side, under "Working Directory", select "Reuse previous sessions directory".
4. Close preferences.
Note. Working Directory allows you to choose which Directory opens in a New Session Window, such as Home Directory, or a Directory of your Choice.

Article Title

Hello world

subheading level 1

I find that offensive

Here is emphasis and different emphasis.