Skip to content

Instantly share code, notes, and snippets.

View sykire's full-sized avatar
🏠
Working from home

Rodrigo sykire

🏠
Working from home
View GitHub Profile
local awful = require("awful")
local wibox = require("wibox")
local gears = require("gears")
local clients_hints = {}
local clients_widgets = {}
local clients_texts = {}
local hints = {}
local hints_tree = {}
local registered = false
---
const links = [
{
title: "The NFT Space",
url: "https://example.com",
text: "Trying to make sense of it all",
},
{
title: "Fonts in 2021",
url: "https://example.com",
export const DELETE = Symbol('DELETE');
/**
* Traverse an object and apply a transformation function to each value.
* The transformation function is called with the value, the key and the key path.
*
* The transformation function can return a new value or the same value.
* If the transformation function returns a new value, the value in the object is replaced with the new value.
*
* The transformation function can return an object.
@sykire
sykire / utils.py
Last active September 17, 2019 22:07 — forked from cxasper/utils.py
from os.path import basename
class EditImgUploadS3:
def __init__(self):
self.s3 = boto3.resource('s3')
self.region = os.getenv('AWS_STORAGE_REGION')
self.bucket = os.getenv('AWS_STORAGE_BUCKET_NAME')
def upload_object(self, image):
new_image = self.draw_rectangle(image)
from typing import Callable, Dict
def map_dict(func: Callable, dictionary: Dict):
'''
Returns a dict with the same keys as `dictionary` and with its
values mapped over `func`
wallet = {'Peter': 20, 'John': 35}
wallet_squared = map_dict(lambda m: m**2, wallet)
'''
@sykire
sykire / per_inline_model_converter.py
Last active April 9, 2021 07:16
Usually in flask-admin inline-models use the same converter. You can set a different converter setting 'inline_converter' in the ModelView but this will apply the same converter for every Model in the inline_models list.So I've overridden the 'scaffold_inline_form_models' method from ModelView just to check for every inline model in the list if …
from flask_admin.form import FormOpts
from flask_admin.contrib.sqla.form import InlineModelFormList, \
InlineModelConverter, \
get_form
from flask_admin.contrib.sqla.tools import get_primary_key
from flask_admin.contrib.sqla import ModelView
from flask_admin.model.fields import InlineModelFormField
from flask_admin.model.form import InlineFormAdmin
from flask_admin._compat import iteritems
@sykire
sykire / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Lo que se logrará:

  • Crear una máquina virtual linux en windows con virtualbox
  • Conectar un cliente ssh con una máquina virtual linux
  • Instalar un IDE para navegador (ICEcoder) usando apache

Primeros pasos

Descargar Putty : http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

#!/usr/bin/env python2
import os
import ast
import argparse
###
import game
#import render
from settings import settings
#import game
import pygame
import sys
from itertools import product
from operator import mul
from functools import partial
NORMAL = 0
OBSTACLE = 1