Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
@aitor
aitor / mermaid.md
Last active June 15, 2023 13:36 — forked from martinwoodward/mermaid.md
GitHub HTML Rendering Pipeline
flowchart TB
    "Failed Payment delivery"-->Policies
    subgraph Retry System
    Policies-->Retrier
    end
    Retrier-->"Selected Action"
@aitor
aitor / README.md
Created October 13, 2019 17:13 — forked from igorwwwwwwwwwwwwwwwwwwww/README.md
clickhouse-playground

clickhouse-playground

capture logs:

heroku logs --tail -a travis-api-production | grep at=info | gsed -e 's/^\([0-9]*-[0-9]*-[0-9]*\)T\([0-9]*:[0-9]*:[0-9]*\)/date=\1 time="\1 \2" /' | lcut date time method path host request_id fwd dyno connect service status bytes > access.log

boot:

@aitor
aitor / 20160307172445_change_paperclip_attachment_path.rb
Created November 20, 2018 11:47 — forked from 121onto/20160307172445_change_paperclip_attachment_path.rb
Example migration for changing paperclip storage path
class MoveAttachmentsToNewLocation < ActiveRecord::Migration
def initialize(name = self.class.name, version = nil)
access_key = Rails.application.secrets.g3_access_key_id
secret_key = Rails.application.secrets.g3_secret_access_key
storage = Fog::Storage::Google.new google_storage_access_key_id: access_key,
google_storage_secret_access_key: secret_key
@bucket_name = Rails.application.secrets.g3_bucket
@bucket = storage.directories.get(@bucket_name)
super(name, version)
@aitor
aitor / notification_flood.rb
Last active January 26, 2017 17:32 — forked from mort/Fighting notification flood with the alea gem
Fighting notification flood with the alea gem
# Activity streams' notifications to third parties are cool because they bring
# a feeling of a shared public space and increase the chance serendipitous findings
# But too much information quickly becomes noise, and relevant bits of news can
# disappear among a tsunami of irrelevant (to me) "x did y with z'
# What we're trying to do here is going from deterministic notifications
# (stuff happens, stuff gets broadcasted) to stochastic ones (stuff happens,
# stuff may gets broadcasted)
@aitor
aitor / README.md
Last active August 3, 2016 22:55 — forked from syntagmatic/README.md
Nutrition Parallel Sets

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@aitor
aitor / cloud_front.rb
Created October 24, 2011 15:54 — forked from glebm/cloud_front.rb
A module to invalidate cache on Amazon CloudFront
require 'openssl'
require 'net/http'
require 'net/https'
module CloudFront
extend self
def invalidate(path)
date = Time.now.utc
date = date.strftime("%a, %d %b %Y %H:%M:%S %Z")
@aitor
aitor / gist:1231604
Created September 21, 2011 08:48 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
/*!
* JavaScript whatevCache - v0.2pre - 12/30/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// whatevCache.set( key, value [, ttl ] );
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Nice Buttons</title>
<style>
* { margin: 0; padding: 0; }
ul {
padding: 20px;
width: 80px;
float: left;