Skip to content

Instantly share code, notes, and snippets.

View alexandregz's full-sized avatar
🎯
Focusing

Alexandre Espinosa Menor alexandregz

🎯
Focusing
View GitHub Profile
@alexandregz
alexandregz / Open in iTerm2-nightly
Last active December 8, 2016 23:10
Apple script to open an iterm2 "nightly" window from right-clicking on a file or folder in Finder. To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
--
-- FINAL VERSION
-- Save as "Application" from Automator and Drag&Drop to finder (see peterdowns post)
--
@alexandregz
alexandregz / keybase.md
Created August 18, 2016 18:47
keybase.md

Keybase proof

I hereby claim:

  • I am alexandregz on github.
  • I am alexandregz (https://keybase.io/alexandregz) on keybase.
  • I have a public key ASA8_JgPdS9iEqCrDLlvfYXMPT-WrwcESEnFu3GJhMfIzQo

To claim this, I am signing this object:

@alexandregz
alexandregz / ncdc.sh
Created August 18, 2016 16:28 — forked from aligusnet/ncdc.sh
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520 Usage: ./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp3.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@alexandregz
alexandregz / install-tmux
Created May 14, 2016 22:37 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@alexandregz
alexandregz / location.command
Created May 8, 2016 18:45
open owntracks recorder with double clicking (OSX)
#!/bin/sh
#
# open owntracks recorder.
#
# Requirements (OSX):
# 1) install recorder (brew tap owntracks/recorder && brew install recorder)
# 2) vi /usr/local/etc/ot-recorder.sh and add mqtt host/login/pass/...
# 3) chmod +x this_script.command
#
#!/usr/bin/env ruby
# <bitbar.title>Battery Apple Bluetooth keyboard</bitbar.title>
# <bitbar.version>1.0</bitbar.version>
# <bitbar.author>Alexandre Espinosa Menor</bitbar.author>
# <bitbar.author.github>alexandregz</bitbar.author.github>
# <bitbar.desc>Show vagrant images running, from vagrant global-status command</bitbar.desc>
#
# command from https://github.com/matryer/bitbar-plugins/issues/84 by @keithamus
#
@alexandregz
alexandregz / keyboard.1m.sh
Last active January 11, 2016 15:49
bitbar plugin using system_profiler command
#!/usr/bin/env perl
# <bitbar.title>Battery Apple Bluetooth keyboard</bitbar.title>
# <bitbar.version>1.0</bitbar.version>
# <bitbar.author>Alexandre Espinosa Menor</bitbar.author>
# <bitbar.author.github>alexandregz</bitbar.author.github>
# <bitbar.desc>Show vagrant images running, from vagrant global-status command</bitbar.desc>
#
# command from https://github.com/matryer/bitbar-plugins/issues/84 by @keithamus
#
@alexandregz
alexandregz / README.md
Created December 2, 2015 07:07 — forked from Coeur/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install osxfuse (3.x.x) from https://github.com/osxfuse/osxfuse/releases.

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@alexandregz
alexandregz / C_test.c
Last active October 1, 2015 15:39
Test perl/perl6/php/php7/C
#include <stdio.h>
#include <math.h>
int main() {
double s=0;
for(int i=1; i<=10000; i++) {
s=s+(1/pow(i, 2));
printf("%d %lf %lf %lf\n", i, s, pow(i,2), 1/pow(i,2) );
}

Quick install PHP 7.0 (phpng):

1. Install depends PHP 7.0 (phpng)
$ brew install autoconf automake bison27 gd freetype t1lib mariadb gettext zlib mcrypt
Add support for Bison 3.x

curl -L https://github.com/php/php-src/pull/685.diff | patch -p1