Skip to content

Instantly share code, notes, and snippets.

View blackymetal's full-sized avatar

Ariel Patino blackymetal

View GitHub Profile
@blackymetal
blackymetal / php.ini used on cli
Created June 14, 2016 16:36
Finding php.ini file that is loaded when executed php from cli
$ php -i |grep php\.ini
@blackymetal
blackymetal / Compressing jpeg image
Created April 12, 2016 22:00
How to compress jpeg using convert
convert -strip -interlace Plane -quality 95% origin.jpg result.jpg
@blackymetal
blackymetal / Install pirateflix
Last active September 18, 2019 14:09
Installing pirateflix avoiding 404 error from npm
// Based on this https://news.ycombinator.com/item?id=11421509
git clone [email protected]:orinocoz/pirateflix.git
cd pirateflix
npm install
chmod +x bin/cli.js
// Execute client
./bin/cli.js
@blackymetal
blackymetal / Install_vim_plugin.sh
Last active March 21, 2016 17:09
Installing a plugin with pathogen
git clone git://github.com/tpope/vim-sensible.git ~/.vim/bundle/vim-sensible
Taken from http://stackoverflow.com/questions/15395479/why-ive-got-no-crontab-entry-on-os-x-when-using-vim
1- In Terminal: crontab -e.
2- Press i to go into vim's insert mode.
3- Type your cron job, for example:
30 * * * * /usr/bin/curl --silent --compressed http://example.com/crawlink.php
4- Press Esc to exit vim's insert mode.
@blackymetal
blackymetal / git-log-author
Last active November 11, 2015 20:39
Show last three commits made by author
git log -3 -p --author="Jorge Angarita"
git log -3 -p --author="John Cortes"
@blackymetal
blackymetal / login.swift
Last active September 4, 2015 21:22
Little login example using swift
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)
func getProduct(session: NSURLSession, codigo: NSString) {
var url_request:NSURL = NSURL(string: url_root as! String + "products/\(codigo).json")!
@blackymetal
blackymetal / curl_as_iphone_mobile
Created February 18, 2015 13:54
Send a request simulating an iPhone with curl
curl -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3" http://www.website.com
@blackymetal
blackymetal / put_elasticsearch
Created October 20, 2014 23:40
Put data to elasticsearch
private function put($data) {
// Open connection
$ch = curl_init();
$url = 'http://127.0.0.1:9200/colombia/bogota/'.$data['id'];
// Set the url, number of POST vars, POST data
curl_setopt( $ch, CURLOPT_URL, $url );
// curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
@blackymetal
blackymetal / watch log
Last active May 24, 2016 16:23
watch the last 15 records in a log file
watch tail -n 15 /usr/local/mysql/data/ArielMac.log