Skip to content

Instantly share code, notes, and snippets.

function getUrlParams() {
var params = location.search;
if (params.length == 0) { return {}; }
var paramsArray = location.search.substring(1).split("&");
var paramsDict = {};
for (var i = 0; i < paramsArray.length; i++) {
var param = paramsArray[i].split("=");
if (paramsDict[param[0]] == undefined) {
paramsDict[param[0]] = [param[1]];
} else {
(function(window) {
'use strict';
var asByte = function(byte) {
var bytes = [];
for (var i = 0; i < this.length; ++i) {
bytes.push(this.charCodeAt(i));
}
return bytes;
};
function asString(array) {
@GuillermoBlasco
GuillermoBlasco / .gitignore
Created March 30, 2015 21:55
tbb-web-template
.idea/
*.iml
*~
dist/
node_modules/
.publish/
src/vendor_comopnents/
@GuillermoBlasco
GuillermoBlasco / query_by_column_name.gs
Last active November 18, 2021 14:49
Google sheets query by column name
/**
* Enhances Google Sheets' native "query" method. Allows you to specify column-names instead of using the column letters in the SQL statement (no spaces allowed in identifiers)
*
* Sample : =query(data!A1:I,SQL("data!A1:I1","SELECT Owner-Name,Owner-Email,Type,Account-Name",false),true)
*
* Params : useColNums (boolean) : false/default = generate "SELECT A, B, C" syntax
* true = generate "SELECT Col1, Col2, Col3" syntax
* reference: https://productforums.google.com/forum/#!topic/docs/vTgy3hgj4M4
* by: Matthew Quinlan
*/
@GuillermoBlasco
GuillermoBlasco / Main.java
Created July 29, 2014 19:47
read hello test
public class Main {
public static void main(String[] args) {
while (true) {
int c = System.in.read();
if ((char)c == 'h') {
System.out.print("hola");
}
}
@GuillermoBlasco
GuillermoBlasco / map.json
Last active August 11, 2019 21:56
open
{
"file" : {
"py":"subl",
"java":"subl",
"cpp":"subl",
"cxx":"subl",
"hpp":"subl",
"h":"subl",
"c":"subl",
"sh":"subl",
@GuillermoBlasco
GuillermoBlasco / enum.py
Created January 2, 2014 22:52
Simulation of enums for python 2.x
# Simulation of enums for python 2.x
class Enum(object):
def __init__(self, **kwargs):
for key, value in kwargs.iteritems():
setattr(self, key, value)
self._asDict = dict(kwargs)
def __contains__(self, item):
@GuillermoBlasco
GuillermoBlasco / .gitignore
Created November 17, 2013 00:55 — forked from kogakure/.gitignore
gitignore for LaTeX projects
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
import time
import BaseHTTPServer
import cgi
HOST_NAME = 'localhost'
PORT_NUMBER = 9200
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_HEAD(s):