Skip to content

Instantly share code, notes, and snippets.

View slezica's full-sized avatar

Santiago Lezica slezica

View GitHub Profile
@slezica
slezica / dcl_get_some_entities.py
Last active May 2, 2023 18:23
Print a list of Decentraland entity IDs for emotes deployed after a certain date.
#!/usr/bin/env python3
import sys
import json
import urllib.request
def http_get(url):
headers = {
"User-Agent": "urllib" # Important! If empty, 403 Forbidden
}

Hey there!

This utility requires 3 things:

  • The fzf tool installed
  • A small git custom command
  • 4 lines of bash in your bashrc

First off, the fzf tool. You can get it from https://github.com/junegunn/fzf . It's an amazing utility to have in your belt, and I've found multiple uses for it over time.

WEBVTT
00:01.000 --> 00:04.000
Never drink liquid nitrogen.
00:05.000 --> 00:09.000
- It will perforate your stomach.
- You could die.
00:11.000 --> 00:14.000
@slezica
slezica / manual.md
Last active September 14, 2015 08:26
Senado Galáctico

Senado Galáctico

En el Senado Galáctico, interpretás el rol de un senador en el cuerpo administrativo más poderoso de la galaxia.

El Senado está presidido por dos cónsules y compuesto por dos cámaras: Centauri y Orión.

Como senador, pertenecés a la delegación diplomáticá de un planeta, estación o sector. Cada delegación tiene dos senadores, que la representan en

@slezica
slezica / example.java
Created June 26, 2015 19:25
Loading XML in custom Android View
package view;
public class CustomComplexView extends FrameLayout {
public CustomComplexView(Context context) {
super(context);
init();
}
public CustomComplexView(Context context, AttributeSet attrs) {
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var concat = require('gulp-concat');
var watch = require('gulp-watch');
var rename = require('gulp-rename');
var gutil = require('gulp-util');
var minifyCss = require('gulp-minify-css');
var sass = require('gulp-sass');
var coffee = require('gulp-coffee');
@slezica
slezica / validation.coffee
Created May 25, 2015 21:55
Simple coffee validation
kindof = (x) ->
if x? then x.constructor else x
validateWithFunction = (object, func) ->
true_or_reason = func(object)
if true_or_reason is true
{ valid: true }
else
{ valid: false, reason: true_or_reason }
@slezica
slezica / convert.coffee
Last active August 29, 2015 14:19
DT db serialized polygon to geoJSON
# Convert from SQL serialized format:
parsePolygon = (polygon_s) ->
for point_s in polygon_s.split('|')
point_s.split(',').map(parseFloat)
toGeoJSON = (polygon) ->
# `polygon` is an array of [lat, lng]
polygon = (point.reverse() for point in polygon)
polygon.push(polygon[0])
# Clásicos

J. D. Salinger      | El Guardián entre el Centeno
Lewis Carroll       | Alicia en el País de las Maravillas
R. L. Stevenson     | Dr. Jekyll y Mr. Hyde
A. Huxley           | Un Mundo Feliz
García Márquez      | Crónica de una Muerte Anunciada
García Márquez      | Cien Años de Soledad
Homero              | La Odisea
request = Promise.promisifyAll require 'request'
refreshToken = (token, refresh_token, provider) ->
request.postAsync
uri: provider.refreshUrl
headers:
'Authorization': "Bearer #{token}"
'Content-Type' : 'application/json'