Skip to content

Instantly share code, notes, and snippets.

View serradura's full-sized avatar
🎯
Focusing

Rodrigo Serradura serradura

🎯
Focusing
View GitHub Profile
@benoitongit
benoitongit / my_vue_component.coffee
Last active May 8, 2021 10:24
Make Vue.js works with Ruby on Rails and Turbolinks 5. Gem is available here: https://github.com/benoitongit/vue-on-rails
@MyComponent =
props: ['myProp']
template: '<div>A custom component with {{myProp}}</div>'
@nateabele
nateabele / trace.js
Created December 1, 2016 07:19
Generates friendly trace info for pipe() / compose()
// Use like: trace("Friendly name", pipe)(map(...), filter(...), etc(...))
export const trace = (name, comp) => (...fns) => comp(...fns.map((fn, i) => {
return (...args) => {
try { return fn(...args); } catch(e) {
e.message = `Error in ${comp.name}() sequence ${name} at step ${i} (${fn.name || '<anon>'}()): ${e.message}`;
throw e;
}
};
}));
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@janko
janko / 01-presentation.md
Last active June 6, 2019 23:58
PostgreSQL full-text search capabilites (my presentation from our local Ruby meetup)

Full-text search

  • Keywords

  • Typos

  • Stemming

  • Stopword ignore

@omegahm
omegahm / create_labels.sh
Created April 7, 2015 19:00
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@gousiosg
gousiosg / stackoverflow.sql
Last active December 6, 2023 22:12
Script to import the stackexchange dumps into MySQL
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
Id INT NOT NULL PRIMARY KEY,
UserId INT,
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mislav
mislav / gist:938183
Created April 23, 2011 02:28
Faraday SSL example
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'
@knu
knu / gist:111055
Created May 13, 2009 14:38
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done