Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jalcine's full-sized avatar
💭
Decentralize and democratize the Web.

Jacky Alciné jalcine

💭
Decentralize and democratize the Web.
View GitHub Profile
@jalcine
jalcine / wps_openwrt.sh
Created May 2, 2016 18:15 — forked from alghanmi/wps_openwrt.sh
WPS on OpenWRT -- Enabling Wi-Fi Protected Setup on OpenWRT
##
## WPS on OpenWRT
## This script enables Wi-Fi Protected Setup on OpenWRT.
##
## Resources
## http://wiki.openwrt.org/doc/uci/wireless#wps.options
##
#Install the full wpad package
opkg update
@jalcine
jalcine / landrush.rst
Created April 26, 2016 20:33 — forked from neuroticnerd/landrush.rst
Vagrant landrush DNS plugin tips and troubleshooting

landrush

landrush is an excellent Vagrant plugin if you are trying to develop or test in a multi-machine VM environment. It works by spinning up a small local DNS server and registering the private network IPs of each machine during vagrant up so that they can be accessed via their hostname in both the host machine as well as the other guest machines. A great bonus of using landrush is that the VMs can be defined in separate Vagrantfiles (e.g. if you have separate git repos for building different machines).

useful commands

  • vagrant landrush status - show whether the DNS server
# Command run by neomake: mix compile.elixir --warnings-as-errors ~prj/web/models/hashtag.ex
Neomake: mix stdout: Compiled lib/api.ex
Neomake: mix stdout:
Neomake: mix stdout done.
Neomake: mix processing 2 lines of output
Neomake: mix stdout: Compiled web/web.ex
Neomake: mix stdout:
Neomake: mix stdout done.
Neomake: mix processing 2 lines of output
Neomake: mix stdout:
@jalcine
jalcine / nginx.conf
Created February 27, 2016 00:48 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;

This Gist is meant to show how testing authentication plugins with an expanded form of configuration versus the inline compact form results in an unexpected failure whilst testing. This case could occur if one wishes to enforce unique authentication options (like a required DB authentication versus a JWT session).

Expanded Form:

  server.route({
    method: 'POST',
 path: '/sample-auth',
@jalcine
jalcine / rnb.erb
Last active September 10, 2015 03:23 — forked from romainl/_rnb.md
RNB, a Vim colorscheme template
<%
# RNB, A VIM COLORSCHEME TEMPLATE
# Author: Romain Lafourcade (https://github.com/romainl)
# Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca
# This template is designed to help vimmers create their own colorschemes
# without much effort.
#
# You will need Ruby to generate your colorscheme but Ruby knowledge is
# not needed at all.
@jalcine
jalcine / controller_spec.rb
Last active August 30, 2015 17:10 — forked from tonycoco/controller_spec.rb
The Greatest Hits of Rspec Testing: Volume 1
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
'use strict'
const initializerNames = ['config', 'db', 'auth']
const Hapi = require('hapi')
let server = new Hapi.Server()
function applyInitializerToServer (initializerName) {
const functor = require('./server/' + initializerName + '.js')
const modifiedServer = functor(server)
server.log('Setting up initializer for ' + initializerName + '...')
@jalcine
jalcine / gist:f58b19ca73a4bcc074d0
Last active August 29, 2015 14:28
Walmart Mobile node.js Setup

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

ruby <<< EOF
require 'socket'
server_thread = Thread.start do
loop do
print 'foo'
end
end
EOF