Skip to content

Instantly share code, notes, and snippets.

View carlosrobles's full-sized avatar

carlosrobles

  • Dubai - Hong Kong - Manila - London - Barcelona
View GitHub Profile
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import android.widget.TextView;
@carlosrobles
carlosrobles / github_release_management.py
Created August 22, 2016 19:05 — forked from RaviH/github_release_management.py
Manages GitHub repository releases
import json
import os
from optparse import OptionParser
import requests
import sys
import logging as log
__author__ = 'ravi'
API_URL = 'https://github.com/api/v3/repos/{}/{}/releases'
@carlosrobles
carlosrobles / slack_history.py
Created September 14, 2016 11:06 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for
# those converations and writes each conversation out to seperate json files.
#
# This user centric history gathering is nice because the official slack data exporter
# only exports public channels.
@carlosrobles
carlosrobles / self_route.vcl
Created July 7, 2018 07:06 — forked from rezan/self_route.vcl
Self routing Varnish Cache cluster example
# Self routing cluster example
vcl 4.0;
import directors;
backend node1 {
.host = "node1.example.com";
.port = "80";
}
@carlosrobles
carlosrobles / add_auto_increment_to_int_single_pk.sql
Last active December 6, 2022 18:53
Add auto_increment to all the single PRIMARY KEY of type int of a database
DROP TABLE if exists temp;
CREATE TABLE temp (
`table` varchar(250) DEFAULT NULL,
`colum` varchar(250) DEFAULT NULL,
`type` varchar(250) DEFAULT NULL,
`number_of_PK` tinyint(2) DEFAULT NULL,
`alter` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@carlosrobles
carlosrobles / cw_exp.js
Created January 18, 2019 19:25 — forked from fbrnc/cw_exp.js
AWS Lambda function that collects relevant metrics from CloudWatch and pushes them to ElasticSearch
var AWS = require('aws-sdk');
var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'});
exports.handler = function (event, context) {
var ElasticSearchHost = 'elasticsearch.example:9200';
var Environment = 'int';
var EndTime = new Date;
var StartTime = new Date(EndTime - 15*60*1000);
var Metrics = {
@carlosrobles
carlosrobles / grab-all-product-attributes.sql
Created March 13, 2019 19:46 — forked from tegansnyder/grab-all-product-attributes.sql
Magento grab all product attributes for a SKU in direct SQL. "static" backend_type attributes are stored in catalog_product_entity
SELECT * FROM ( SELECT
ce.sku,
ea.attribute_id,
ea.attribute_code,
CASE ea.backend_type
WHEN 'varchar' THEN ce_varchar.value
WHEN 'int' THEN ce_int.value
WHEN 'text' THEN ce_text.value
WHEN 'decimal' THEN ce_decimal.value
WHEN 'datetime' THEN ce_datetime.value
@carlosrobles
carlosrobles / Readme.txt
Created April 23, 2020 14:05 — forked from jcward/Readme.txt
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//