Skip to content

Instantly share code, notes, and snippets.

View josketres's full-sized avatar

Josue Zarzosa josketres

View GitHub Profile
<html>
<body>
<h1 id="title">Combinations</h1>
<input type="text" id="numbers" value="1,2,3,4,5" />
<input type="text" id="stars" value="1,2,3" />
<input type="submit" id="byBtn" value="Change" onclick="change()" />
<div id="info"></div>
<div id="combinations"></div>
<script>
@josketres
josketres / mongoosehere-install.sh
Last active August 29, 2015 14:04
Serve files in the current directory using 'mongoosehere' command
#!/bin/bash
# https://gist.github.com/josketres/45c53c2a3c50a7424bb9
# Install mongoose binary in your ~/bin and add 'mongoosehere' alias
# ------------------------------------------------------------------
# mongoosehere - Start an http server in your current directory
# assuming that ~/bin is added to your $PATH (in your .bashrc)
cd ~/bin
wget -O mongoose https://mongoose.googlecode.com/files/mongoose-lua-sqlite-ssl-static-x86_64-5.1
chmod +x mongoose
@josketres
josketres / gist:605f9c1146516c183d8c
Last active August 29, 2015 14:07
pimp-my-vim-on-windows.txt
cd %USERPROFILE%\vimfiles
wget --no-check-certificate https://raw.githubusercontent.com/sickill/vim-monokai/master/colors/monokai.vim
@josketres
josketres / gist:26e1d26d3bcf22dd4dca
Last active August 29, 2015 14:13
Nice java8 stuff
Comparator<Person> compareByName = Comparator.comparing(Person p -> p.getName());
try (Stream<String> lines = Files.lines(Paths.get("text.txt"))) {
long count = lines
.flatMapToInt(String::codePoints)
.filter(c -> !Character.isSpaceChar(c))
.count();
System.out.printf("Count: %d", count);
} catch (Exception e) {
@josketres
josketres / keybase.md
Created March 30, 2015 16:15
keybase.md

Keybase proof

I hereby claim:

  • I am josketres on github.
  • I am josketres (https://keybase.io/josketres) on keybase.
  • I have a public key whose fingerprint is 5A1E 25E3 0E8E 0D1A 2ABE 23B8 C19D D50E 869B 4D63

To claim this, I am signing this object:

@josketres
josketres / maxymiser-cookbook.md
Created June 9, 2015 12:46
Cookbook of maxymiser snippets

fff

@josketres
josketres / install-git.sh
Created June 15, 2015 10:41
Install newest git on CentOS 6
# from https://www.digitalocean.com/community/tutorials/how-to-install-git-on-a-centos-6-4-vps
# added curl-devel - https://stackoverflow.com/questions/8329485/git-clone-fatal-unable-to-find-remote-helper-for-https/13018777#13018777
TMPDIR=/data/tmp
sudo yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel curl-devel
cd ~
wget -O git.zip https://github.com/git/git/archive/master.zip
unzip git.zip
rm git.zip
cd git-master
make configure
@josketres
josketres / bowerw
Last active August 29, 2015 14:23
Bower wrapper
#!/usr/bin/env bash
# Bower wrapper script for UN*X
# https://gist.github.com/josketres/f7a970e55a2e61533206
bower_bin=bower
command bower >/dev/null 2>&1 || {
bower_bin=$HOME/.bowerw/bin/bower
echo "Global bower not found, using $bower_bin";
command $bower_bin >/dev/null 2>&1 || {
@josketres
josketres / gruntw
Last active August 29, 2015 14:23
Grunt-cli wrapper
#!/usr/bin/env bash
# Grunt-cli wrapper script for UN*X
# https://gist.github.com/josketres/0e90b4e2b4a9e414708c
grunt_bin=grunt
grunt_check=" --version"
log_prefix="\e[95mgruntw\e[0m -"
command $grunt_bin $grunt_check >/dev/null 2>&1 || {
@josketres
josketres / Benchmark.js
Last active August 26, 2015 09:31
Small library to do benchmark in javascript
var Benchmark = function() {
};
Benchmark.prototype.start = function() {
this.start = new Date().getTime();
console.time('Benchmark');
};
Benchmark.prototype.stop = function() {