Skip to content

Instantly share code, notes, and snippets.

View pateketrueke's full-sized avatar

Alvaro Cabrera Durán pateketrueke

View GitHub Profile
function nvm
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv
set -l node_dir "$HOME/.nvm/versions/node"
switch (echo $argv[1])
case install
case use
set -l node_version (ls $node_dir | grep $argv[2])
set -l node_version (echo $node_version | cut -d " " -f1)
@pateketrueke
pateketrueke / README.md
Created July 9, 2016 23:28
Tarima + Express

Write the following view-script:

src/example.js.hbs.pug

h1 {{value}}

Execute npm start.

Dependencies

  • npm i tarima-cli [engines] -ES

Where [engines] are the following described in the README.

{
  "scripts": {
@pateketrueke
pateketrueke / AWSECommerce.json
Last active June 2, 2016 00:12
JSON-Schema Faker / dereferencing issues / see #28 #80
{
"id": "http://webservices.amazon.com/AWSECommerceService/2013-08-01#",
"definitions": {
"ItemLookupRequest": {
"type": "object",
"title": "ItemLookupRequest",
"properties": {
"condition": {
"title": "condition",
"allOf": [{
@pateketrueke
pateketrueke / rhino-shim.js
Last active March 25, 2016 20:11
Timers and XHR for ol' Rhino support
// http://ejohn.org/blog/bringing-the-browser-to-the-server/
// timers, xhr
// The window Object
var window = this;
(function(){
var curLocation = (new java.io.File("./")).toURL();
@pateketrueke
pateketrueke / package.json
Created March 9, 2016 06:15
Disallow empty objects from generated values
{
"dependencies": {
"json-schema-faker": "git+https://github.com/json-schema-faker/json-schema-faker.git#prune-empty-props"
}
}
@pateketrueke
pateketrueke / mysqlfu.sql
Created November 13, 2013 05:41
MySQL snippets (WUT)
CREATE DATABASE <dbname>;
CREATE USER '<dbuser>'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON <dbname> . * TO '<dbuser>'@'localhost';
REVOKE ALL PRIVILEGES ON <dbname> . * FROM '<dbuser>'@'localhost';
@pateketrueke
pateketrueke / addsite.sh
Last active December 27, 2015 17:59
Adds and removes custom vhosts on Apache2
#!/bin/sh
MYSELF="$(whoami)"
WWWDIR="$HOME/www"
DOMAIN=$1
VHOSTDIR="/usr/local/apache2/conf/vhosts"
if [ "$MYSELF" != "root" ]; then
echo "You must execute this as root"
else
@pateketrueke
pateketrueke / slash-lang.txt
Last active December 26, 2015 15:19
Slash lang!
# ubuntu
git clone git@github.com:slash-lang/slash.git
sudo apt-get install libmarkdown2-dev libmysqlclient-dev libyajl-dev libgmp-dev
# apache2
sudo apt-get install apache2 apache2-prefork-dev
sudo ln -s /usr/bin/apxs2 /usr/bin/apxs
sudo ln -s /usr/sbin/apache2 /usr/bin/httpd
# make
@pateketrueke
pateketrueke / Monokai.tmTheme
Last active December 24, 2015 21:09
My Monokai-dark settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>