Skip to content

Instantly share code, notes, and snippets.

View amejiarosario's full-sized avatar
🎯
Think big, start small, learn fast!

Adrian Mejia amejiarosario

🎯
Think big, start small, learn fast!
View GitHub Profile
# ./sublime_text
# libgio version is less than 2.26, single instance support disabled
# Segmentation fault (core dumped)
## FIX ##
# You must have gtk-doc installed to compile GLib.
sudo apt-get install gtk-doc-tools
git clone git://git.gnome.org/gtk-doc
@amejiarosario
amejiarosario / unix_tricks
Created March 12, 2013 16:18
unix tricks
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg
// single arrow at the end
Raphael.fn.arrow = function(x1, y1, x2, y2, size) {
var angle = Raphael.angle(x1, y1, x2, y2);
var a45 = Raphael.rad(angle-45);
var a45m = Raphael.rad(angle+45);
var x2a = x2 + Math.cos(a45) * size;
var y2a = y2 + Math.sin(a45) * size;
var x2b = x2 + Math.cos(a45m) * size;
var y2b = y2 + Math.sin(a45m) * size;
return this.path(
#
# Wi-Fi SSID Sniffer in 9 Lines of Ruby using Raw Sockets
#
# No Gem, no lib, just plain Ruby.
# You have to run it with root/sudo.
# My Ruby version is 1.9.3 and I run Linux.
require 'socket'
sock = Socket.new(Socket::PF_PACKET, Socket::SOCK_RAW, 0x03_00)
curl -XDELETE http://localhost:9200/ac-test
#curl -XPUT http://localhost:9200/ac-test
# --- Mapping ---
curl -XPOST 'http://localhost:9200/ac-test
'{"mappings" : { {
"people" : {
"properties" : {
"firstNames" : {
"type" : "string"
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- If you delete this tag, the sky will fall on your head -->
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ZURBemails</title>
<style data-inline="true">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- If you delete this tag, the sky will fall on your head -->
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ZURBemails</title>
<style data-inline="true">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- If you delete this tag, the sky will fall on your head -->
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ZURBemails</title>
<style data-inline="true">
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@amejiarosario
amejiarosario / vi_cheatsheet.sh
Last active December 22, 2015 11:28
Vi cheatsheet from novice to pro!
# Get started with basic commands
# http://www.worldtimzone.com/res/vi.html
# Setup a VIM with plugins
curl -Lo- https://bit.ly/janus-bootstrap | bash
# Read documentation
# https://github.com/carlhuda/janus