Skip to content

Instantly share code, notes, and snippets.


Vaghula krishnan vaghul

View GitHub Profile
View import_json_appsscript.js
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
vaghul / resize-vi.swift
Created March 20, 2018 08:11 — forked from darcwader/resize-vi.swift
Resize Image using vImage
View resize-vi.swift
extension UIImage {
func resizeVI(size:CGSize) -> UIImage? {
let cgImage = self.CGImage!
var format = vImage_CGImageFormat(bitsPerComponent: 8, bitsPerPixel: 32, colorSpace: nil,
bitmapInfo: CGBitmapInfo(rawValue: CGImageAlphaInfo.First.rawValue),
version: 0, decode: nil, renderingIntent: CGColorRenderingIntent.RenderingIntentDefault)
var sourceBuffer = vImage_Buffer()
defer { * Int(sourceBuffer.height) * 4)
vaghul / resize-ui.swift
Created March 20, 2018 08:11 — forked from darcwader/resize-ui.swift
Resizing Image using UIKit
View resize-ui.swift
extension UIImage {
func resizeUI(size:CGSize) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, true, self.scale)
self.drawInRect(CGRect(origin: CGPointZero, size: size))
let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
return resizedImage
vaghul /
Created December 30, 2017 08:34 — forked from witooh/
Install Graphicsmagick
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:rwky/graphicsmagick
sudo apt-get update
sudo apt-get install graphicsmagick
vaghul /
Last active November 1, 2017 06:39 — forked from learncodeacademy/
Adding a deploy user in Linux

(wherever it says, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo adduser deploy admin
sudo passwd deploy

And Update the new password

vaghul /
Created October 29, 2017 15:29 — forked from learncodeacademy/
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
vaghul / client.js
Created July 27, 2017 08:32 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);