Skip to content

Instantly share code, notes, and snippets.

View gtarun's full-sized avatar
💭
Busy changing the world

Tarun Gupta gtarun

💭
Busy changing the world
View GitHub Profile
@gtarun
gtarun / linux-ami-redis-install.sh
Created December 27, 2013 06:48
This file help you to install redis-server automatically on you AWS Linux-AMI Run these commands. git clone https://gist.github.com/8143507.git cd 8143507 sh linux-ami-redis-install.sh
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# <<!!!!!!!!!!!!!!!!!!! FIX ME !!!!!!!!!!!!!!!!!!!!!!!!> wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
<VirtualHost 109.74.199.47:80>
ServerAdmin davy.brion@thatextramile.be
ServerName thatextramile.be
ServerAlias www.thatextramile.be
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
-- phpMyAdmin SQL Dump
-- version 4.0.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 06, 2014 at 11:02 AM
-- Server version: 5.5.33
-- PHP Version: 5.5.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@gtarun
gtarun / app.js
Created June 24, 2014 10:31 — forked from clarle/app.js
// Module dependencies
var express = require('express'),
mysql = require('mysql');
// Application initialization
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@gtarun
gtarun / fullCalendarDisablePrevNext.js
Last active September 17, 2015 04:39 — forked from juanbrujo/fullCalendarDisablePrevNext.js
jQuery FullCalendar.js: disable prev/next button for past/future dates
$('#calendar').fullCalendar({
viewRender: function(currentView){
var minDate = moment(),
maxDate = moment().add(2,'weeks');
// Past
if (minDate >= currentView.start && minDate <= currentView.end) {
$(".fc-prev-button").prop('disabled', true);
$(".fc-prev-button").addClass('fc-state-disabled');
}
else {
@gtarun
gtarun / shell
Created October 23, 2015 10:46 — forked from am/shell
Kaleidodcope "xcrun: error: cannot be used within an App Sandbox..."
cd /Applications/Kaleidoscope.app/Contents/Resources/Integration/scripts
./install_git-default
@gtarun
gtarun / angular2_deploy.sh
Created August 8, 2016 09:47
Script helps to reduce the effors of repeating the process of commands
# Deploy script
# First ignore the changes in current branch
git checkout .
# go to master branch and push the data then merge to staging for auto deploy
git checkout master && git pull --no-edit
git checkout staging && git merge master --no-edit
echo "Started Building app"
@gtarun
gtarun / hook.js
Last active April 13, 2018 13:11
GIT hook for multiple repositories with respect to branches, written in Nodejs for Ubuntu/Linux server
/* Create a webhook in your GIT repo and put your IP-ADDRESS:1340
* select content-type : application/json
* do a npm install github-webhook-handler
* to start the server - node hook.js
*
*/
var http= require("http");
var exec = require('child_process').exec;
var createHandler = require('github-webhook-handler');
#copy files to server with ssh
scp -i ~/.ssh/stagingventurepactcom.pem outgrow-theme.zip deploy@54.221.234.80:/home/deploy/apps
#forever start with uid
forever --uid "hooks" start server.js
#Hide/show hidden files
defaults write com.apple.finder AppleShowAllFiles YES