Skip to content

Instantly share code, notes, and snippets.

View firminochangani's full-sized avatar
🖊️
probably shipping software.

Firmino Changani firminochangani

🖊️
probably shipping software.
View GitHub Profile
@nrshrivatsan
nrshrivatsan / apache_not_nginx
Last active December 5, 2016 05:24
Ubuntu Kill nginx + Start Apache 2
# ubuntu 14.01 comes with nginx I guess.For simple testing purposes I use apache2.
########################################################
# Assumption
# - nginx & apache2 have already been installed on ubuntu 14.04
# Goal
@e1024kb
e1024kb / gist:41bf38fdb1a2cb19a781
Created September 27, 2014 13:29
Country - state list in JSON
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@vitorbritto
vitorbritto / commands.md
Last active June 9, 2016 12:44
Unix References

Unix Commands

Environment Control

cd d                         Change to directory d
mkdir d                      Create new directory d
rmdir d                      Remove directory d
mv f1 [f2...] d              Move file f to directory d
mv d1 d2                     Rename directory d1 as d2

passwd Change password

@valdiney
valdiney / gist:8682216
Last active January 4, 2016 21:39
TriggersAnAction_Script: 0.1 Script para ocultar e mostrar elementos em uma página. Interessante para apresentar ao usuário determinadas partes de um site.
///////////////////////////////////////////////////////
//
// Project: TriggersAnAction_Script
// author: Valdiney França
//
//////////////////////////////////////////////////////
/*
@JedWatson
JedWatson / notes.md
Last active February 20, 2020 13:01
Notes on how to create a new field type for Keystone

Creating new Field Types for KeystoneJS

We're currently working on making it easier to add new field types to KeystoneJS as plugins.

In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.

Keystone fields require the following:

  • a {fieldType}.js file in ./lib/fieldTypes that controls the field and encapsulates options support, underscore functions, validation and updating
  • the {fieldType}.js file needs to be included by ./lib/fieldTypes/index.js
@vitorbritto
vitorbritto / setup_vitorbritto_workspace.md
Last active June 22, 2019 02:48
My Workspace Setup

Setup - My Workspace

This is my workspace reference documentation in case I need to install and prepare it again. Is up to you (me) if you want to run this step by step. Use it wiselly. =]

1. Backup

  • Desktop
  • Projects
  • Transfers
  • Documents
@valdiney
valdiney / gist:5689319
Created June 1, 2013 05:00
Menu estilo tipico de celulares! Reparei este menu em um celular com o windows Mobile
window.onload = function(){
// Resgatando Menu
var menu = document.getElementById('menu');
// Aplica as funções após o click
var show_menu = document.getElementById('show_menu').onclick = function(){
// Verifica o estado do menu e aplica o valor relevante a situação
if(menu.style.display == 'none'){
ocultaMenu('block');
}else{
@valdiney
valdiney / gist:5283772
Last active December 15, 2015 15:39
Class feita através de uma função construtora calcula o "Teorema de Pitagoras", sendo que também contem uma função incluída para calcular a "area". encontra a altura
<script>
/*
Class através de função construtora calcula o "Teorema de Pitagoras",
sendo que também contem uma função incluida para calcular a "area".
-----------------------------------------------------------------------
Autor: Valdiney França
Linguagem: javascript
*/
function Teorema_pitagoras(H,b){
@fennb
fennb / gist:1124535
Created August 4, 2011 05:04
node.js proxy server in 20 lines of JS (via http://www.catonmat.net/http-proxy-in-nodejs/)
var http = require('http');
http.createServer(function(request, response) {
var proxy = http.createClient(80, request.headers['host'])
var proxy_request = proxy.request(request.method, request.url, request.headers);
proxy_request.addListener('response', function (proxy_response) {
proxy_response.addListener('data', function(chunk) {
response.write(chunk, 'binary');
});
proxy_response.addListener('end', function() {