Skip to content

Instantly share code, notes, and snippets.

View pallavsharma's full-sized avatar
🎯
Focusing

Pallav Sharma pallavsharma

🎯
Focusing
View GitHub Profile
$ sudo apt-get update
$ sudo apt-get install unzip wget
$ wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
$ unzip ngrok-stable-linux-amd64.zip
$ sudo mv ./ngrok /usr/bin/ngrok
$ ngrok
---
title: "Creation of a Landscape: The Logic or Urbanization in the PRC"
description: NYU East Asian Studies Department, MA Thesis Defense
date: 2013-11-01
layout: pdf
categories: writing
permalink: /writing/creation-of-a-landscape/
---
<iframe src="https://docs.google.com/file/d/0B8aGkJVsdqiJamVpUnJ1TDlFbFU/preview" width="100%" height="100%"></iframe>

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@jimishjoban
jimishjoban / gist:ac7d003318b08d09ef25
Created September 24, 2015 06:31
/etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@eliotsykes
eliotsykes / rails_new_help_output.md
Last active March 31, 2024 17:09
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@pallavsharma
pallavsharma / bowling_match_score_calculator
Created February 5, 2015 12:25
Bowling match score calculator.
def bowling(input)
scores = []
result = []
scores = input.split.collect { |e| e.to_i }
cf = 0 # current frame
i = 0
while(cf < 10) do
if scores[i] == 10 # For strike
result[cf] = scores[i] + scores[i + 1] + (scores[i + 2] ? scores[i + 2] : 0)
@asuh
asuh / Preferences.sublime-settings
Last active November 17, 2022 18:53
Sublime Text 3 User Preferences sublime-settings file
{
"always_show_minimap_viewport": true,
// Using ⌘-P, these files will never be shown in results
"binary_file_patterns":
[
"*.ai",
"*.dds",
"*.eot",
"*.gif",
"*.ico",
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@tadast
tadast / ssl_puma.sh
Last active January 29, 2024 04:41 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@athap
athap / JQuery Flash Messages
Created September 1, 2012 17:43
Rails like flash messages using JQuery for JS or AJAX calls
# This gist shows how to display Rails like flash messages while handling AJAX or JS requests
# Note - This might not be the best way to do this but it works for me
Step 1. Create a partial which will contain the message to be displayed
Example - _success.html.erb
<div id="flash_message">
<p>Success</p>
</div>
Step 2. In the Controller, add code to call this partial on a JS request