Skip to content

Instantly share code, notes, and snippets.

View silverbux's full-sized avatar

Alex Quiambao silverbux

  • Philippines
View GitHub Profile
@silverbux
silverbux / gist:960ff93aea3897a658e38a7da25d95b0
Created November 10, 2018 01:39 — forked from dosjota/gist:9666a7274b4036588b92987b84267245
Downgrade php 7.2 to 7.1 in Ubuntu 18.04 LTS
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.1-intl php7.1-simplexml
sudo a2dismod php7.2
sudo a2enmod php7.1
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php7.1
sudo update-alternatives --set phar /usr/bin/phar7.1
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1
@silverbux
silverbux / nationality.html
Created May 22, 2017 07:19 — forked from didats/nationality.html
Nationality List in HTML Dropdown
<select name="nationality">
<option value="">-- select one --</option>
<option value="afghan">Afghan</option>
<option value="albanian">Albanian</option>
<option value="algerian">Algerian</option>
<option value="american">American</option>
<option value="andorran">Andorran</option>
<option value="angolan">Angolan</option>
<option value="antiguans">Antiguans</option>
<option value="argentinean">Argentinean</option>
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html

Hosting compatible with Node

Managed

Managed providers provide a simplified "Node Appliance" solution. Node and NPM will already be set up for you, and deploys are typically done via git push or similar method. You will have less control of your server, but everything will be set up for you.

Name Node Version Web Sockets IP/Hostname IRC Repository Free Plan Paid Plans Notes
appfog 0.4.12, 0.6.17, 0.8.14, 0.10.22 No Yes, custom domains in paid plan only appfog Free Signups suspended Yes – monthly subscriptions and enterprise support available General Availability
Azure 0.6+ Yes Yes Azure-Sdk-for-Node 3 month free trial 10 free web sites forever Yes
@silverbux
silverbux / pr.md
Created December 9, 2015 06:20 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@silverbux
silverbux / dokku-setup.sh
Last active November 27, 2015 01:53
Setup dokku on digitalocean + install mongodb plugin + fix mongodb remote connection issues + fix digital ocean memory issues
#!/bin/bash
dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo &&
docker pull mongo:2.6.11 &&
apt-get install -y mongodb-clients &&
echo 'export MONGO_CONFIG_OPTIONS=" --auth "' >> ~/.bashrc &&
echo 'export MONGO_IMAGE_VERSION="2.6.11"' >> ~/.bashrc &&
sudo swapon -s &&
sudo fallocate -l 4G /swapfile &&
ls -lh /swapfile &&
web:
build: ./coder/
expose:
- "5000"
links:
- "db:redis"
- "mongodb"
command: nodemon -L app/server/server.js
nginx:
web:
build: ./node
volumes:
- "app:/src/app"
expose:
- "3000"
links:
- "db:redis"
- "mongodb"
command: nodemon -L app/server/server.js
@silverbux
silverbux / process.nextTick.js
Last active September 15, 2015 02:05 — forked from WebReflection/process.nextTick.js
process.nextTick(callback) for browsers too
!function (window) {"use strict";
// by WebReflection - WTFPL License
var
prefixes = "r webkitR mozR msR oR".split(" "),
process = "process",
nextTick = "nextTick",
i = 0,
p = window[process] || (window[process] = {})
;
while (!p[nextTick] && i < prefixes.length)