Skip to content

Instantly share code, notes, and snippets.

View dieg0's full-sized avatar
:bowtie:
Working

Diego Vargas dieg0

:bowtie:
Working
View GitHub Profile
#!/bin/sh
# make sure you have imagemagick installed: brew install imagemagick
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons
x=my_icon.png
y=${x%.*}
# delete the export directory so we start clean
@tomhicks
tomhicks / plink-plonk.js
Last active July 22, 2024 09:51
Listen to your web pages
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@lopezjurip
lopezjurip / README.md
Created December 16, 2016 21:08
macOS: Yarn + nvm with globals (bins) to $PATH

Yarn and nvm

  • Requisites: brew

Install nvm:

brew install nvm
@nirnaeth
nirnaeth / _upgrade-pg9.4-to-pg9.5.md
Created December 6, 2016 15:37 — forked from chbrown/_upgrade-pg9.4-to-pg9.5.md
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@kiyoto
kiyoto / collatz.markdown
Created May 1, 2016 09:10
The Collatz Conjecture in PostgreSQL

##QUERY (PostgreSQL 9.4)

WITH RECURSIVE t(n) AS (
  VALUES(1337)
  UNION ALL
  SELECT CASE WHEN n%2=0 THEN n/2 ELSE 3*n+1 END FROM t WHERE n > 1)
SELECT * FROM t
@vasanthk
vasanthk / System Design.md
Last active July 22, 2024 17:59
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@logicbomb
logicbomb / twilio_error_codes.csv
Last active September 3, 2023 22:06
Twilio error codes
Code Desc Details
10001 Account is not active https://www.twilio.com/docs/api/errors/10001
10002 Trial account does not support this feature https://www.twilio.com/docs/api/errors/10002
10003 Incoming call rejected due to inactive account https://www.twilio.com/docs/api/errors/10003
11100 Invalid URL format https://www.twilio.com/docs/api/errors/11100
11200 HTTP retrieval failure https://www.twilio.com/docs/api/errors/11200
11205 HTTP connection failure https://www.twilio.com/docs/api/errors/11205
11206 HTTP protocol violation https://www.twilio.com/docs/api/errors/11206
11210 HTTP bad host name https://www.twilio.com/docs/api/errors/11210
11215 HTTP too many redirects https://www.twilio.com/docs/api/errors/11215