Skip to content

Instantly share code, notes, and snippets.

View gugat's full-sized avatar

Gustavo Salazar gugat

  • Buk
  • Santiago - Chile
View GitHub Profile
@loreabad6
loreabad6 / conteo_votos.R
Last active February 12, 2021 17:01
Diferencia entre @yakuperezg y @LassoGuillermo, tweets de @angiegomeza de los resultados del CNE.
library(rtweet)
library(tidyverse)
library(lubridate)
library(gganimate)
# Extraer tweets de Andrea Gomez
reconteo = search_tweets(
q = "angiegomeza AND Actualización AND Diferencia",
include_rts = F
)
@gaearon
gaearon / Classes.js
Created May 27, 2020 17:38
Beneath Classes: Prototypes
class Spiderman {
lookOut() {
alert('My Spider-Sense is tingling.');
}
}
let miles = new Spiderman();
miles.lookOut();
require 'minitest/autorun'
require 'minitest/spec'
#:nodoc:
class TestCompensation < Minitest::Test
def setup
@compensation = Compensation.new
end
describe 'when worked less than 12 months' do
@mankind
mankind / rails-jsonb-queries
Last active April 17, 2024 12:14
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@gugat
gugat / Preferences.sublime-settings
Created August 8, 2016 18:37
Preferences for Sublime text editor
{
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
"line_numbers": false,
"match_brackets": false,
"rulers":
[
@thesowah
thesowah / plh.rb
Last active July 30, 2021 18:02
Parse link headers from Github API in Ruby
require 'rest_client'
class Plh
def self.parse_link_header(url, params={})
response = RestClient.get url, params
links = Hash.new
parts = response.headers[:link].split(',')
# Parse each part into a named link
parts.each do |part, index|
@rxaviers
rxaviers / gist:7360908
Last active May 8, 2024 23:25
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@pid
pid / keystroke-toggle-linenumbers-settings.json
Created October 21, 2013 20:17
Sublime Text keystroke toggle line numbers show/hide
{
"keys": ["ctrl+alt+l"],
"command": "toggle_setting",
"args": {
"setting": "line_numbers"
}
@carlosmcevilly
carlosmcevilly / gist:2221249
Created March 27, 2012 22:55
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@bendo01
bendo01 / usefull_macports_command
Created November 4, 2011 04:46
usefull macports command
http://stackoverflow.com/questions/1817219/how-do-i-install-ruby-on-mac-leopard
port install ruby19+nosuffix
http://www.jotlab.com/2009/11/08/installing-ruby-on-rails-mysql-imagemagick-nginx-passenger-with-macports/
sudo port uninstall --follow-dependents portname
http://blog.ntrippy.net/2009/07/home-made-nginx-phusion-passenger-dep_01.html
sudo port uninstall nginx && sudo port clean nginx
//clean up all ports macports