Skip to content

Instantly share code, notes, and snippets.

View arn-ob's full-sized avatar
☠️
__worker__

Arnob arn-ob

☠️
__worker__
View GitHub Profile
@mattd
mattd / gist:1006398
Created June 3, 2011 14:12
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;
@tshinnic
tshinnic / httpclnt03.js
Created December 1, 2011 00:40
Example of binding socket for nodejs HTTP client request (for discussion only)
// One shot request HTTP client - show local/remote addresses
//
// Attempt to use a modified Agent that has own self.createConnection()
// that binds the client socket to a particular address.
var assert = require('assert'),
dns = require('dns'),
http = require('http'),
net = require('net'),
util = require('util');
@mashdot
mashdot / README.md
Created April 5, 2012 17:00
Bacula concurrent jobs multiple storage devices client labeled pools debian installation configuration.
Time-stamp: <2012-03-30 Fri 16:56 README.md>
Author....: 'Mash (Thomas Herbert)

TOSHINE-BACULA

Bacula concurrent jobs multiple storage devices client labeled pools Debian installation and configuration.
Please see http://toshine.org/etc for full article.

Bacula Debian Installation.

@oscar-broman
oscar-broman / free-port.js
Created May 26, 2013 12:14
Find a free port in Node.js
/*
Much better approach than trying to connect to a range of ports.
*/
var net = require('net');
getFreePort(function(err, port) {
if (err) throw err;
console.log('Port: ' + port);
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@learncodeacademy
learncodeacademy / generators.md
Last active January 7, 2024 11:58
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@mirek
mirek / find-and-refresh-rand.js
Created November 19, 2014 21:04
Find random document in MongoDB collection.
// Install packages:
// npm install mongodb async
// Add index in mongo:
// db.ensureIndex('mycollection', { rand: 1 })
var mongodb = require('mongodb')
var async = require('async')
// Find n random documents by using "rand" field.
@SantoshSrinivas79
SantoshSrinivas79 / Inject javascript into HTML pages from console.md
Last active May 12, 2021 05:51
Inject javascript into HTML pages from console

#Inject javascript into HTML pages from console

An easy way to inject Javascripts into the current loaded dom using the developer console in chrome.

jQuery

var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
@alexbilbie
alexbilbie / Caddyfile
Created January 7, 2016 15:29
PHP-FPM Caddyfile example
root /app/public
tls /app/_docker/caddy/server.crt /app/_docker/caddy/server.key
fastcgi / php:9000 php
errors visible
rewrite {
regexp .*
ext /
to /index.php?{query}
}