Skip to content

Instantly share code, notes, and snippets.

View yashodhank's full-sized avatar
🎯
Manifesting

Yashodhan yashodhank

🎯
Manifesting
View GitHub Profile

Comparison of ASP.NET and Node.js for Backend Programming

We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.

Updates

This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):

  1. Koa.js no longer uses co-routines, it has switched to Babel's async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.
@yashodhank
yashodhank / tmux-cheatsheet.markdown
Created August 12, 2016 02:35 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yashodhank
yashodhank / .htaccess
Last active August 22, 2016 05:17 — forked from jennimckinnon/.htaccess
Changing the maximum upload and PHP memory limit for WordPress.
php_value upload_max_filesize 1000M
php_value post_max_size 2000M
php_value memory_limit 3000M
php_value max_execution_time 1000
php_value max_input_time 1000
php_value max_input_vars 9000
@yashodhank
yashodhank / Emacs_starter.pl
Created August 25, 2016 07:29 — forked from railwaycat/Emacs_starter.pl
Start Emacs.app from CLI
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
@yashodhank
yashodhank / readme.md
Created August 31, 2016 06:56 — forked from joubertredrat/readme.md
Install Gogs from binary on VestaCP panel

Install Gogs from binary on VestaCP

This tutorial was written based on Ubuntu 14.04 with VestaCP.

For this example, I created user cooler, domain repo.my.cooler and database cooler_repo on VestaCP panel.

To install Gogs, you will need to use user with admin rights, on my tutorial I'm using default admin user from VestaCP.

1 - install supervisor.

@yashodhank
yashodhank / gist:10050c703fdd5ee6662129927ece16f0
Created September 3, 2016 10:21 — forked from aarvay/gist:1341918
A RESTful API to check the PNR Status
<?php
require_once('pwi/phpQuery.php'); //Including phpQuery Library
/**
* The input for the REST api is got via "GET"
*/
$pnr1 = $_GET['pnr1']; //The first 3 digits of your PNR
$pnr2 = $_GET['pnr2']; //Remaining digits
@yashodhank
yashodhank / 01-server-config-in-git.md
Created November 22, 2016 01:56 — forked from juzna/01-server-config-in-git.md
Server Configuration in git

Server Configuration in git

With git you can have anything versioned. You're used to version your code, which is a bunch of files. Your server configuration (on Linux) is also just a bunch of files, so it can be versioned as well.

The idea is simple: create a git repository in /etc/ and commit everytime you change any configuration of your server. Written in code:

cd /etc
git init
git add .
@yashodhank
yashodhank / run.sh
Created January 12, 2017 08:30 — forked from Hades32/run.sh
Start a docker container with environment variables for external port and IP
#!/bin/bash
#Start a docker container with environment variables for external port and IP
if [ -z $1 ]
then
echo pass in starting port
exit 1
fi
START_PORT=$1
@yashodhank
yashodhank / convertExcel2Sheets
Created January 15, 2017 05:56 — forked from azadisaryev/convertExcel2Sheets
Google Apps Script for converting Excel (.xls or .xlsx) file to Google Spreadsheet. Drive API must be enabled in your script's Advanced Google Services and in Developers Console for the script to work (see https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services for details).
/**
* Convert Excel file to Sheets
* @param {Blob} excelFile The Excel file blob data; Required
* @param {String} filename File name on uploading drive; Required
* @param {Array} arrParents Array of folder ids to put converted file in; Optional, will default to Drive root folder
* @return {Spreadsheet} Converted Google Spreadsheet instance
**/
function convertExcel2Sheets(excelFile, filename, arrParents) {
var parents = arrParents || []; // check if optional arrParents argument was provided, default to empty array if not
@yashodhank
yashodhank / invoicepdf.tpl
Created January 20, 2017 23:44 — forked from maevelander/invoicepdf.tpl
Custom Invoice PDF template for WHMCS
<?php
# Logo
$logoFilename = 'placeholder.png';
if (file_exists(ROOTDIR . '/assets/img/logo.png')) {
$logoFilename = 'logo.png';
} elseif (file_exists(ROOTDIR . '/assets/img/logo.jpg')) {
$logoFilename = 'logo.jpg';
}
$pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 15, 25, 75);