Skip to content

Instantly share code, notes, and snippets.

View shishirsharma's full-sized avatar
🤑
Focusing

Shishir Sharma shishirsharma

🤑
Focusing
View GitHub Profile
@shishirsharma
shishirsharma / will_paginate.rb
Last active December 22, 2015 03:28 — forked from isaacbowen/will_paginate.rb
Works with Bootstrap 3 and Will_paginate 3.0.4 and Sinatra
# gist https://gist.github.com/expertmind/6410029
# Based on https://gist.github.com/isaacbowen/1182136
module WillPaginate
module Sinatra
module Helpers
include ViewHelpers
def will_paginate(collection, options = {}) #:nodoc:
@shishirsharma
shishirsharma / .emacs
Created October 14, 2013 05:26
Melpa for emacs
;;;
;;; ELPA
;;;
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
@shishirsharma
shishirsharma / .tmux.conf
Last active December 25, 2015 11:48
Here is how to get colors working and allow native scrollback in terminal.app
# Show colors
set -g default-terminal "xterm-color"
# Allow native scroll back in terminal.app
set -ga terminal-overrides 'xterm*:smcup@:rmcup@'
# Tmux/Screen tab title
case "$TERM" in
screen)
PROMPT_COMMAND="printf '\033k$(hostname -s)\033\';"${PROMPT_COMMAND}
;;
esac
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
@shishirsharma
shishirsharma / ethernet.c
Created October 14, 2013 09:51
How to access a website with multiple virtual hosts from Arduino Ethernet Shield
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 6, 30 };
byte server[] = { ***, ***, 168, 16 }; // Your VPS
@shishirsharma
shishirsharma / .irbrc
Last active February 9, 2020 10:22
IRB Console with history and logging
#! /usr/bin/env ruby
# -*- Ruby-*-
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline",
"--prompt-mode",
"simple" ]
# 100 entries in the list
$ sudo apt-get install imagemagick
$ sudo apt-get install poppler-utils
@shishirsharma
shishirsharma / winexample.cpp
Created June 22, 2014 09:08
Windows GUI example code.
// Windows GUI example code
#include < windows.h >
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsExApp";
@shishirsharma
shishirsharma / python-2.6-config.bat
Created June 22, 2014 09:20
python-2.6-config.bat
@ECHO OFF
@SET PATH= %PATH%;C:appandyourpathhere;D:appandonemore
@SET SOMEVARABLE=E:somepath
@SET DIRCMD=/D /N
@PROMPT $G
@ECHO Setting environment for YOURSYSTEM VER
@ECHO %TIME% %DATE%
@ECHO Namaskar Criss.