Skip to content

Instantly share code, notes, and snippets.

@oraricha
oraricha / rails_resources.md
Created October 28, 2013 17:08 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@oraricha
oraricha / css_resources.md
Created October 28, 2013 17:08 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@oraricha
oraricha / javascript-books.md
Created October 28, 2013 17:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
@oraricha
oraricha / code
Created August 29, 2013 16:24
Invalidate session on tab or window close (not tested!!)
/*JS code begins here*/
/*Global js variable to decide whether to call session invalidate function*/
var validNavigation = false;
//Called when page loads initially
jQuery(document).ready(function() {
//Call to wireupEvents
wireUpEvents();
var loggedInDeferred = $.Deferred();
//Data().method("isLoggedin")
loggedInDeferred = Account("isLoggedin");
loggedInDeferred = isLoggedin();
@oraricha
oraricha / Theme editor.md
Last active December 18, 2015 08:59
List of my sublime text 2 installed packages
@oraricha
oraricha / urlRegex.js
Last active August 29, 2015 14:13
url regex for ftp/http/https, can be without protocol name as well - using with contenteditable
var urlRegex = /^((?:ftp|http|https)?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i;
/* the following will enforce appearance of 'www' while the protocol is optional, but if appears, must be correct */
urlRegex = /^((ftp|http|https)?:(\/\/)|(w{3}\.))((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i;
/*check url on contenteditable element*/
var currentText,
$element = $("[contenteditable='true']");
var replaceAll = function (find, replace, str) {
// http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
module.exports = function(grunt) {
/**
* Saves having to declare each dependency
*/
require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks );
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

AngularJS

AngularJS is somewhere in between a framework and a library, and as such it lets us benefit of both worlds:

As a library it:

  • Doesn't require a particular layout of files at development time
  • Is lightweight and small in size (79kb)
  • Works great with other technologies. Add as much or as little of AngularJS to an existing page as we like, and as much or as little of other libraries as well
  • Is modular - every feature can be modified or replaced to suit our unique development workflow and feature needs
  • Has no global state and multiple apps can run on a single page without the use of iframes
(function( $ ) {//my scope
var _obj = {},//container for plugin
_appName = 'MYDEFAULTPLUGINNAME';//will be visible in global scope, use unique name
_obj[_appName] = window[_appName] = new function(){//exposing to global scope
var _ = {//private methods
defaults:{},
settings:{},
l:function(severity, message) {
var _args = Array.prototype.slice.apply(arguments);
console[severity](_appName + ' :: ' + _args.slice(1, 2), _args.slice(2));