Skip to content

Instantly share code, notes, and snippets.

@ale7714
ale7714 / haikus.md
Last active October 7, 2021 02:52
Haikus

Trader Joe’s Peanut Butter cups

Perfect balance of salty smoothness and rich bittersweet cocoa

Little nuggets of happiness in your mouth

This recipe will yield around 4 arepas

Ingredients

  1. 1 1/2 cups of Harina P.A.N (Pre-cooked white corn meal)
  2. 2 cups of water (I prefer the water to be at a warm temperature)
  3. 1 teaspoon of salt
  4. 1 teaspoon of corn oil

Preparation

@ale7714
ale7714 / .travis.yml
Last active February 4, 2020 16:55
CC test reporter on Travis parallel builds
language: ruby
env:
global:
- CC_TEST_REPORTER_ID=<repo_test_reporter_id>
- RSPEC_PARALLELISM=4 # total number of jobs
matrix:
- "RSPEC_TEST_GROUP=1"
- "RSPEC_TEST_GROUP=2"
- "RSPEC_TEST_GROUP=3"
- "RSPEC_TEST_GROUP=4"
@ale7714
ale7714 / copy_dd_dashboard
Created May 21, 2017 23:36
Copy Datadog Dasboards between accounts
#!/bin/sh
# inspired from https://gist.github.com/lrascao/f57312ff33b799c4c0db56b10e80fe26
from_app_key="$1"
from_api_key="$2"
from_dash_id="$3"
to_app_key="$4"
to_api_key="$5"
dd_dash_url="https://app.datadoghq.com/api/v1/dash"
if [ "$#" -eq 5 ]
@ale7714
ale7714 / log.txt
Created April 30, 2017 19:27
offset kafka
Apr 27 08:55:51 ip-10-20-51-10 docker/wally: I, [2017-04-27T12:55:51.941959 #1] INFO -- wally-3760fbc8-306f-4123-a9c1-398980c06a38: Consumer: marking analysis-results/0:6683654257 as processed
Apr 27 08:55:51 ip-10-20-51-10 docker/wally: I, [2017-04-27T12:55:51.942044 #1] INFO -- wally-3760fbc8-306f-4123-a9c1-398980c06a38: Committing offsets: analysis-results/0:6683654258
Apr 27 08:55:51 ip-10-20-51-10 docker/wally: I, [2017-04-27T12:55:51.949699 #1] INFO -- wally-3760fbc8-306f-4123-a9c1-398980c06a38: Runner: flushed buffers offset=6683654257
Apr 27 08:55:51 ip-10-20-51-10 docker/wally: I, [2017-04-27T12:55:51.956491 #1] INFO -- wally-3760fbc8-306f-4123-a9c1-398980c06a38: Consumer: marking analysis-results/0:6683654258 as processed
Apr 27 08:55:51 ip-10-20-51-10 docker/wally: I, [2017-04-27T12:55:51.956537 #1] INFO -- wally-3760fbc8-306f-4123-a9c1-398980c06a38: Committing offsets: analysis-results/0:6683654259
Apr 27 08:55:51 ip-10-20-50-50 docker/wally: I, [2017-04-27T12:55:51.967832 #1] INFO -
@ale7714
ale7714 / copy_datadog_screen
Created February 1, 2017 20:31
Script to copy Screendashboard to a new Datadog account
#!/bin/sh
# inspired from https://gist.github.com/lrascao/f57312ff33b799c4c0db56b10e80fe26
app_key="$1"
api_key="$2"
screen_id="$3"
request_url="https://app.datadoghq.com/api/v1/screen/$screen_id?api_key=$api_key&application_key=$app_key"
curl -X GET "$request_url" > screen.json
read -p "New app key: " napp_key
read -p "New api key: " napi_key
@ale7714
ale7714 / test.json
Last active January 28, 2017 13:47
Ramdon json file (6.5M)
{
"coverage_reports": [
{
"_id": "588bb1ac0badc76da0d82306",
"index": 0,
"guid": "310a4af7-8d54-469a-b533-802344c2d64b",
"isActive": false,
"balance": "$2,019.33",
"picture": "http://placehold.it/32x32",
"age": 29,
@ale7714
ale7714 / taxonomie.php
Created October 28, 2015 05:52
Add taxonomie to WP
<?php
// Doc: https://codex.wordpress.org/Function_Reference/register_taxonomy
register_taxonomy('portfolio_tag','portfolio',array(
'hierarchical' => false,
'labels' => array(
'name' => _x( 'Tags', 'taxonomy general name' ),
'singular_name' => _x( 'Tag', 'taxonomy singular name' ),
'search_items' => __( 'Search Tags' ),
@ale7714
ale7714 / warn_expectation.rb
Created November 3, 2014 14:56
Custom warn message expectation
require 'rspec'
require 'stringio'
# Custom matcher to test message written when warn
#
# Example
# expect { subject.do_something }.to warn('Some error message')
#
# Source
# http://danielchangnyc.github.io/blog/2014/01/15/tdd2-RSpecMatchers/