Skip to content

Instantly share code, notes, and snippets.

Miguel Espinoza purefan

Block or report user

Report or block purefan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@purefan
purefan / fif
Last active May 15, 2018
This is what I use to have a pretty "Search in files". In debian based distros you can add it to /usr/bin/fif and call it like this: fif whatever
View fif
#!/bin/bash
find . -not -iwholename '*.svn*' -type f -print | xargs egrep --color=auto --line-number --no-messages "$1"
@purefan
purefan / loading_time
Created Apr 17, 2013
Small script to measure loading times, stores loading times in format: real 0m1.468s user 0m0.000s sys 0m0.008s repeatedly so another script or an improved version of this one would be needed to parse averages and whatnot
View loading_time
#!/bin/bash
for i in {1..200}
do
echo "Run $i"
(time curl -silent -L "http://server" -output /dev/null) > /dev/null 2>> "bench.log"
done
View gist:5473424
ââ⬠cli-color@0.2.2
â âââ es5-ext@0.9.2
â ââ⬠memoizee@0.2.4
â âââ event-emitter@0.2.1
â âââ next-tick@0.1.0
ââ⬠engine.io@0.5.0
â âââ base64id@0.1.0
â âââ debug@0.6.0
â âââ engine.io-parser@0.3.0
â ââ⬠ws@0.4.25
@purefan
purefan / tree
Created Apr 27, 2013
Display folders in linux as tree. A script in bash provided by http://www.centerkey.com/tree/ No copyright infringement inteded, I couldn't find a license in the site. Pasted here just in case.
View tree
#!/bin/sh
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
# ------------------------------------------------- #
# This tiny script uses "ls", "grep", and "sed" #
# in a single command to show the nesting of #
@purefan
purefan / app.class.php
Last active Jan 6, 2016
Basic library and sample html page showing how to create a basic app for PHPFox
View app.class.php
<?php
class FoxApp
{
private $_sFoxUrl = null;
private $_sAppId = null;
private $_sToken = null;
public function __construct($sFoxUrl = null, $sAppId = null)
{
@purefan
purefan / socket.io listen to http
Created Mar 22, 2014
Quick reminder of how to make socket.io listen to an http server. Most examples online that I have found use Express which is ok, but for a small thing might be an overkill
View socket.io listen to http
// This is how we can make a socket.io server listen to an http connection
var http = require('http');
var socket = require('socket.io');
// Im not sure if the order is important
http.createServer(function(req,res){
// handle requests to your http server
});
// we tell socket.io to listen to the http node
View front end pretty log
var log=function(){for(var a in arguments)if(0==a){if(-1<arguments[a].indexOf("::")&&(arguments[0]="[ "+arguments[a]+" ]"),arguments[0]!=this.logLastCalled){var b="%c "+Array(20).join(" ")+arguments[a]+Array(40-arguments[a].length).join(" "),c="background: #222;color: #bada55;";-1<arguments[0].indexOf("Error ")&&(b=b.replace("Error ",""),c="background: #222; color: #FF0000;");console.log(b,c)}}else"string"==typeof arguments[a]&&-1<arguments[a].indexOf("Yellow:")?console.log("%c "+arguments[a].replace("Yellow:",""),"background: #222, color: #FFFD40;"):console.log(arguments[a]);this.logLastCalled=arguments[0]};
@purefan
purefan / gist:335626db8cf739c9cd08
Created Sep 24, 2014
Sublime natural tab order
View gist:335626db8cf739c9cd08
Put in (Preferences -> Key Bindings - User):
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
View gist:4a33210d4bbec670b843
Verifying that +purefan is my Bitcoin username. You can send me #bitcoin here: https://onename.io/purefan
@purefan
purefan / gist:b3e72ed6847edfcf7eaa
Created Mar 7, 2015
NullPointer Exception running build-deps.sh
View gist:b3e72ed6847edfcf7eaa
[info] Set current project to tmp-6tdmfihlov (in build file:/tmp/tmp.6tdmfIhloV/)
[info] Packaging /tmp/tmp.6tdmfIhloV/target/scala-2.10/tmp-6tdmfihlov_2.10-0.1-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Updating {file:/tmp/tmp.6tdmfIhloV/}tmp-6tdmfihlov...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Wrote /tmp/tmp.6tdmfIhloV/target/scala-2.10/tmp-6tdmfihlov_2.10-0.1-SNAPSHOT.pom
[info] :: delivering :: default#tmp-6tdmfihlov_2.10;0.1-SNAPSHOT :: 0.1-SNAPSHOT :: integration :: Sat Mar 07 01:14:23 UTC 2015
[info] delivering ivy file to /tmp/tmp.6tdmfIhloV/target/scala-2.10/ivy-0.1-SNAPSHOT.xml
[info] Packaging /tmp/tmp.6tdmfIhloV/target/scala-2.10/tmp-6tdmfihlov_2.10-0.1-SNAPSHOT-javadoc.jar ...
You can’t perform that action at this time.