Skip to content

Instantly share code, notes, and snippets.

View atinder's full-sized avatar

Atinder Singh atinder

View GitHub Profile
@atinder
atinder / deploy.rb
Created August 19, 2013 06:07 — forked from chipotle/deploy.rb
# Capistrano Laravel 4 Deployment Tasks
# Watts Martin (layotl at gmail com)
# https://gist.github.com/chipotle/5506641
# updated 14-Aug-2013
# Assumptions:
#
# - You are using a .gitignore similar to Laravel's default, so your
# vendor directory and composer(.phar) are *not* under version control
# - Composer is installed as an executable at /usr/local/bin/composer
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
@atinder
atinder / wp.sh
Last active August 29, 2015 14:06 — forked from samface/wp.sh
#!/bin/bash
# Exit this bash script if any statement returns a non-true return value (same as: set -e)
set -o errexit
if [ -z "$1" ]; then
echo
echo "ERROR: Must pass parameter of absolute or relative path to directory where Wordpress is to be installed."
echo "USAGE: $0 path/to/public/html/dir"
echo
@atinder
atinder / .bowerrc
Last active August 29, 2015 14:15 — forked from ericlbarnes/.bowerrc
{
"directory": "vendor/bower_components"
}
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@atinder
atinder / simple-capistrano-docker-deploy.rb
Created October 20, 2015 18:36 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@atinder
atinder / curried.es5.js
Last active June 15, 2017 05:41 — forked from ryanseddon/curried.es5.js
ES5 vs ES6 function currying
function curry(fn) {
var args = [].slice.call(arguments, 1);
function curried(fnArgs) {
if (fnArgs.length >= fn.length) {
return func.apply(null, fnArgs);
}
return function () {
return curried(fnArgs.concat([].slice.apply(arguments)));
@atinder
atinder / gist:b39ff15e2b379aa68a13228628722dd0
Created September 27, 2018 15:24 — forked from jtperreault/gist:5161942
This is the service script for Nginx installed to /opt/ by the Phusion Passenger gem. This script should reside in /etc/init.d/ and is invoked to manage the nginx process from the command line like so: $ service nginx restart
#! /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
{
"Type" : "SubscriptionConfirmation",
"MessageId" : "0941b7b3-4797-44e5-8079-dbf8ef09793f",
"Token" : "2336412f37fb687f5d51e6e241d164b0533302ec696efc8f113cd2252ce8a925c1e44a3c4ca2984675da85b9bd8c05da85337beb1f24a9c659b22ed3a8cc682f3457c4ead28d392a40e5c35c0e9>
"TopicArn" : "arn:aws:sns:us-west-2:164053224164:email-list",
"Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:164053224164:email-list.\nTo confirm the subscription, visit the SubscribeURL included in this message",
"SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:164053224164:email-list&Token=REDACTED",
"Timestamp" : "2013-10-05T17:00:04.135Z",
"SignatureVersion" : "1",
"Signature" : "<REDACTED>"