Skip to content

Instantly share code, notes, and snippets.

View droganaida's full-sized avatar

Aida Drogan droganaida

View GitHub Profile
const Promise = require('bluebird')
// link to API (just sign up to get the key )):
// https://rapidapi.com/divad12/api/numbers-1
const https = require('https')
//======================= jsonGet Function =======================//
function jsonGet (day=1, month=0){
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@atma
atma / nginx.conf
Created August 18, 2013 16:45
Nginx + nodejs + socket.io websockets
# Add to nginx.conf http section
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@mrlannigan
mrlannigan / res.render.js
Created February 27, 2013 21:02
res.render Override Middleware
/**
* Override res.render to do any pre/post processing
*/
app.use(function(req, res, next) {
var render = res.render;
res.render = function(view, options, fn) {
var self = this,
options = options || {},
req = this.req,
app = req.app,
<!--
doing a large chunked upload of content using html5's file input feature is tricky.
this simple example should help you out.
-->
<br>
<br>
@arian
arian / crop.js
Created August 5, 2012 19:33
Cropping images with nodejs streams and imagemagick
var spawn = require('child_process').spawn;
var Stream = require('stream');
/**
* crops and resizes images to our desired size
* @param {Stream} streamIn in stream containing the raw image
* @return {Stream}
*/
exports.cropImage = function(streamIn){