Skip to content

Instantly share code, notes, and snippets.

Helping robots to steal all jobs

Gabriel Lima the-glima

Helping robots to steal all jobs
View GitHub Profile
dougbacelar / github-pr-untested-files.js
Last active Jun 20, 2019
Tampermonkey script to flag untested files on PR's
View github-pr-untested-files.js
// ==UserScript==
// @name Github PR Untested Files
// @namespace
// @version 0.1
// @description Helps reviewing PR's
// @author Doug Bacelar
// @match*
// ==/UserScript==
'use es6';


Users have a hard time dealing with errors.

To solve that, put these emojis prominently in your error messages. Then when the user says:

I dont know what happened but I saw a christmas tree and then everything stopped working

You'll know it was an internal error!

akirattii / background.js
Created Dec 2, 2016
Message passing of Chrome Extension example
View background.js
* onMessage from the extension or tab (a content script)
function(request, sender, sendResponse) {
if (request.cmd == "any command") {
sendResponse({ result: "any response from background" });
} else {
sendResponse({ result: "error", message: `Invalid 'cmd'` });
the-bass / application.html.erb
Last active Apr 15, 2020
Using Google Analytics with Rails 5 and Turbolinks 5. This code is taken from the conversation between @preetpalS and @packagethief on
View application.html.erb
<%# Put this code snippet between the <head></head>-tags in your application layout and %>
<%# replace 'UA-XXXXXXXX-X' with your own unique Google Analytics Tracking ID %>
<%# ... %>
<%# ... %>
<% if Rails.env.production? %>
<script type="text/javascript">
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
parmentf /
Last active Aug 9, 2020
Git Commit message Emoji
benlinton /
Last active Jul 31, 2020
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

View sass-7-1-pattern.scss
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
developit /
Last active Jun 8, 2020
Webpack Starter Template

Webpack Starter Template

This is a basic Webpack project template for a web app written in ES6 & LESS.

This assumes you have a directory structure as follows:

SleepWalker / swipe.js
Created Sep 30, 2015
A simple swipe detection on vanilla js
View swipe.js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
rponte /
Last active Aug 5, 2020
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
You can’t perform that action at this time.