Skip to content

Instantly share code, notes, and snippets.

View getUrlParams.js
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 {
View gist:5227ccb65fc399260a0a
(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) {
View .gitignore
.idea/
*.iml
*~
dist/
node_modules/
.publish/
src/vendor_comopnents/
@GuillermoBlasco
GuillermoBlasco / query_by_column_name.gs
Last active Aug 29, 2015
Google sheets query by column name
View query_by_column_name.gs
/**
* 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
*/
View Main.java
public class Main {
public static void main(String[] args) {
while (true) {
int c = System.in.read();
if ((char)c == 'h') {
System.out.print("hola");
}
}
View map.json
{
"file" : {
"py":"subl",
"java":"subl",
"cpp":"subl",
"cxx":"subl",
"hpp":"subl",
"h":"subl",
"c":"subl",
"sh":"subl",
@GuillermoBlasco
GuillermoBlasco / enum.py
Created Jan 2, 2014
Simulation of enums for python 2.x
View enum.py
# 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 Nov 17, 2013 — forked from kogakure/.gitignore
gitignore for LaTeX projects
View .gitignore
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
View server.py
import time
import BaseHTTPServer
import cgi
HOST_NAME = 'localhost'
PORT_NUMBER = 9200
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_HEAD(s):
You can’t perform that action at this time.