Skip to content

Instantly share code, notes, and snippets.

View jaromero's full-sized avatar

Antonio Romero jaromero

View GitHub Profile
@jaromero
jaromero / browser-debug.sh
Last active January 10, 2020 18:43
Launch a browser for remote debugging (vscode, etc)
#!/bin/bash
# Launch a browser with a specific profile and remote debugging port open
# symlink this file into chrome-debug, firefox-nightly-debug, etc.
NAME=$(basename $0)
# Open dev tools by default
OPEN_DEVTOOLS=true
@jaromero
jaromero / fuck-adumen.js
Last active May 10, 2018 20:39
Userscript to trick Adumen into not destroying the page content
// ==UserScript==
// @name Fuck You Adumen
// @namespace http://gm.pulsar.mx/
// @version 0.1
// @description Trick Adumen into not destroying the page content
// @author Antonio Romero
// @match http://*.wikia.com/*
// @match https://*.wikia.com/*
// @grant none
// @downloadURL https://gist.github.com/raw/16ddbf66c010f5b1acff829612b4b050/fuck-adumen.js
@jaromero
jaromero / PKGBUILD
Created September 11, 2017 22:08
Last known blob emojis for Arch
# Based on this PKGBUILD: https://aur.archlinux.org/packages/noto-fonts-emoji-blob/
pkgname=noto-fonts-emoji-blob
_pkgver=2017-07-17
_commit=e456654119cc3a5f9bebb7bbd00512456f983d2d
pkgver=${_pkgver//-}
pkgrel=1
pkgdesc="Google Noto emoji fonts (blob version)"
arch=(any)
url="https://www.google.com/get/noto/"
@jaromero
jaromero / init.coffee
Created May 23, 2016 04:38
Smart home/end commands for Atom
atom.commands.add 'atom-text-editor',
'user:smart-home': ->
if (editor = atom.workspace.getActiveTextEditor())
bufferPos = editor.getCursorBufferPosition()
screenPos = editor.getCursorScreenPosition()
bufferLine = editor.lineTextForBufferRow bufferPos.row
screenLine = editor.lineTextForScreenRow screenPos.row
screenLineStart = editor.clipScreenPosition [screenPos.row, 0], skipSoftWrapIndentation: true
@jaromero
jaromero / checkerboard.scss
Created February 5, 2016 18:56
Checkerboard background pattern mixin
@mixin checkerboard ($c1, $c2, $sx, $sy) {
// Usage:
// @include checkerboard(<color 1>, <color 2>, <cell width>, <cell height>);
$sx2: ($sx * 2);
$sy2: ($sy * 2);
background: {
color: $c1;
image: linear-gradient(to bottom right, $c2 25%, transparent 25%, transparent 75%, $c2 75%, $c2),
linear-gradient(to bottom right, $c2 25%, transparent 25%, transparent 75%, $c2 75%, $c2);
position: 0 0, $sx $sy;
@jaromero
jaromero / date.js
Created October 16, 2015 22:44
Kludgey monkey-patched ES6 UTC-enabled Date()
// Do not use if you need something else from Date
// This only naively looks for a date with the format YYYY-MM-DD
// No other cases are covered or guaranteed to still work
// This is just a demo
// Save the old Date thing
var _Date = Date;
// Override the native Date thing
Date = function (string) {
@jaromero
jaromero / commit-guidelines.md
Last active August 25, 2016 00:36
Commit message guidelines

Commit Message Guidelines

These guidelines are meant to be a simple, effective way to quickly discern the type of contribution in our projects, as well as an attempt to enforce limiting commits to a single topic and avoid unwieldy commits

It's based on Angular's contribution guidelines, and this document about commit messages in general. I suggest that you give them a read, too.

The general idea

A commit message consists of, at the very least, the summary. It may also include a body, separated from the summary by a blank line.

@jaromero
jaromero / dom-based-routing.coffee
Last active August 29, 2015 14:20
DOM-based routing in CoffeeScript
# DOM-based routing
# http://paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/
# Now ported to coffeescript by [email protected]
UTIL =
fire: (func, funcname, args) ->
namespace = SITE # indicate your obj literal namespace here
funcname = if funcname? then 'init' else funcname
namespace[func]?[funcname]? args

Yeoman 1+ in Windows in 5 minutes

These steps are all performed in cmd.exe

  1. Install Chocolatey NuGet
  2. Install node.js and ruby:
    1. cinst nodejs.install (the "nodejs" package does not include npm, which we do need)
    2. cinst ruby1.9 (the "ruby" package installs ruby 2.0, which might not work)
  3. Restart cmd.exe because Windows is dumb and can't see the new binaries yet in cmd.exe
  4. gem install compass --pre (NuGet has a "compass" package, but it's old, outdated, and doesn't work anymore)
@jaromero
jaromero / Gruntfile.js
Created August 14, 2013 23:24
Sample kludgey Gruntfile.js to use with coffeescript and r.js
// Generated on 2013-07-10 using generator-webapp 0.2.6
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down: