Skip to content

Instantly share code, notes, and snippets.

View gtramontina's full-sized avatar

Guilherme J. Tramontina gtramontina

View GitHub Profile
@gtramontina
gtramontina / leaflet-dom-event-bridge.js
Created September 22, 2023 22:07
leaflet-dom-event-bridge.js
L.Map.addInitHook(function () {
const dom = this.getContainer();
const forward = (e) =>
dom.dispatchEvent(
new CustomEvent(`map:${e.type}`, {
detail: {
originalEvent: e,
zoom: this.getZoom(),
center: this.getCenter(),
@gtramontina
gtramontina / run.py
Created December 15, 2020 02:28
Makefile-like Python script
#!/usr/bin/env python3
import sys
from inspect import getmembers, isfunction
from os.path import getmtime, exists
from pathlib import Path
from shutil import which
from subprocess import call
def pre_requisites():
@gtramontina
gtramontina / mac-functions
Created September 4, 2014 06:59
brew_cask_install
brew_cask_install() {
if ! brew_cask_is_installed "$1"; then
brew cask install "$@"
fi
}
brew_cask_is_installed() {
local NAME=$(brew_cask_expand_alias "$1")
brew cask list -1 | grep -Fqx "$NAME"
}
@gtramontina
gtramontina / watches.js
Created May 18, 2016 05:10
Angular Watches
(function () {
var head = document.getElementsByTagName('head')[0];
var styles = document.createElement('style');
styles.innerHTML = `
[data-watchers]:hover {
outline: 1px dotted black;
}
[data-watchers]:hover:before {
content: attr(data-watchers);
@gtramontina
gtramontina / css.css
Created October 22, 2012 23:47
Overflow scroll vs. Padding (http://jsbin.com/emowom/3/)
* { box-sizing: border-box; } /* IMO this should be the default box sizing. */
body {
font-family: 'Helvetica Neue';
font-size: 12px;
}
body > h1 {
text-transform: uppercase;
font-weight: 100;
[21:56] bentomas: that does make sense. this might be getting a bit over my head...
[22:10] JimBastard: is there an object-hash mapper for redis / node.js?
[22:12] keeto has joined the channel
[22:26] tfickett has joined the channel
[22:27] the_undefined has joined the channel
f1 = (a, b) -> alert "#{a} and #{b}"
f2 = (ignored, args...) -> f1 args
f2 'string1', 'string2', 'string2'
getRoom = (roomId) ->
room = nowjs.getGroup roomId
return room if room.augumented
room.drawings = []
room.now.sendStartDrawing = (x, y) ->
room.currentDrawing = [ x: x, y: y ]
room.now.startDrawing x, y
room.now.sendDraw = (x, y) ->
@keyframes movingBorder
$border-radius = 25px
from
border-top-left-radius $border-radius
border-top-right-radius 0
border-bottom-right-radius $border-radius
border-bottom-left-radius 0
text-shadow 0 0 10px yellowgreen
color yellowgreen
50%
@gtramontina
gtramontina / gist:969393
Created May 12, 2011 20:37
freenode.net #Node.js log 05/12/2011
[17:51] gtramont1na: Hey tjholowaychuk, I'm having a hard time using variables inside a @keyframes... Any ideas?
[17:52] tjholowaychuk: gtramont1na: hmm can you send me a gist? I'll take a look
[17:52] gtramont1na: https://gist.github.com/969067
...
[17:53] gtramont1na: Im using the $ as an identifier for me to know the variables in my .styl
[17:54] gtramont1na: I also tried moving the '$border-radius = 25px' to inside that @keyframes but then it doesn't even compile
...
[17:55] tjholowaychuk: gtramont1na: one sec ill try
[17:55] gtramont1na: tks
...