Skip to content

Instantly share code, notes, and snippets.

View oozzal's full-sized avatar
🇳🇵
learning

Uzzal Devkota oozzal

🇳🇵
learning
View GitHub Profile
@oozzal
oozzal / ruby_setup.md
Created February 1, 2016 10:50 — forked from julionc/ruby_setup.md
Deploy Ruby On Rails on Ubuntu 14.04

Deploy Ruby On Rails on Ubuntu 14.04

Server: Nginx with Phusion Passenger

Ruby Version: 2.1.3

User System: deploy

User System

@oozzal
oozzal / benchmark.rb
Last active August 29, 2015 14:18 — forked from aboltart/gist:f90cab21db56073ff947
Ruby Benchmarking Test Cases.
#===========================================
# 1. Benchmark
#
require 'benchmark'
Benchmark.bmbm do |x|
x.report ('<<') do
1_000_000.times do
one = 'one'
two = 'two'
@oozzal
oozzal / rails_resources.md
Last active August 29, 2015 14:13 — 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
@oozzal
oozzal / javascript_resources.md
Last active August 29, 2015 14:13 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@oozzal
oozzal / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
(function() {
var users = [
{
id: '100001671834399',
name: 'Krishna Bashyal',
nickname: 'Krrish',
sound: false
},
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="viewport"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script>
<script src="//threejs.org/examples/js/controls/OrbitControls.js"></script>
<object width='425' height='344'>
<param name='movie' value='http://www.youtube.com/v/a0BOPX8yy4g&amp;fs=1' />
<param name='allowFullScreen' value='true' />
<param name='allowscriptaccess' value='always' />
<embed id='ytplayer' src='http://www.youtube.com/v/a0BOPX8yy4g&amp;fs=1' type='application/x-shockwave-flash' width='425' height='344' allowscriptaccess='always' allowfullscreen='true' />
</object>
<div class="STplayer STplayerEmbedded STplayerBarebones" id="STtranscriptEmbed_1_a0BOPX8yy4g" data-version="1.0">
<div class="STbar">
<div class="STlogo"><a href="http://speakertext.com/captionbox?ref=cb" target="_blank"></a></div>