Skip to content

Instantly share code, notes, and snippets.

View tuliomonteazul's full-sized avatar

Tulio Monte Azul tuliomonteazul

View GitHub Profile
@zthomas
zthomas / intercom-delete-old-users.js
Last active May 1, 2023 15:28
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
// License: MIT, feel free to use it!
const Intercom = require('intercom-client');
const appId = 'APP_ID'
const apiKey = 'APP_KEY'
const client = new Intercom.Client(appId, apiKey);
const async = require('async-q')
//REF: https://developers.intercom.com/reference#iterating-over-all-users
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again
@ZwodahS
ZwodahS / copy_redis_key.sh
Created March 1, 2016 06:07
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gullitmiranda
gullitmiranda / Azkfile.js
Created April 23, 2015 16:22
Azkfile.js to configure `public` folder in nginx of `php-fpm`
systems({
"my-app": {
image: {"docker": "azukiapp/php-fpm"},
provision: [
// "composer install",
],
workdir: "/azk/#{manifest.dir}",
mounts: {
'/azk/#{manifest.dir}': path("."),
'/etc/nginx/sites-enabled/nginx_public.conf': path("./nginx_public.conf")
@JuanitoFatas
JuanitoFatas / solution.md
Last active August 29, 2015 14:13
Solution to Could not download rvm, curl returned status '23'
Downloading https://github.com/wayneeseguin/rvm/archive/1.26.9.tar.gz
curl: (23) Failed writing body (0 != 861)
Could not download 'https://github.com/wayneeseguin/rvm/archive/1.26.9.tar.gz'.
curl returned status '23'.
Downloading https://bitbucket.org/mpapis/rvm/get/1.26.9.tar.gz
curl: (23) Failed writing body (0 != 15973)
Could not download 'https://bitbucket.org/mpapis/rvm/get/1.26.9.tar.gz'.

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@andyshinn
andyshinn / DEISAWS.md
Last active April 5, 2017 04:22
Deis AWS Deployment

Deploying Deis on AWS

These instructions will get you up and running with Deis and CoreOS in a AWS VPC. There already exists a CloudFormation script to get up and running in AWS. But if you want to get down and dirty, this document will help walk you through the steps.

I tried to build these instructions for both the AWS web console and equivilent AWS CLI. If you find errors, please feel free to comment so I can update them. You can also find me in the #deis IRC channel on Freenode if you have questions.

AWS

Since we will be running CoreOS and Deis inside a VPC we need some AWS setup first. We need a single subnet VPC, some security groups, and instances of CoreOS.

@ericsaboia
ericsaboia / uncaughtException.js
Created May 19, 2014 15:11
Sending emails on uncaughtException
if (config.admin.email) {
process.on('uncaughtException', function(err) {
console.log(err.stack);
nodemailer.createTransport("SMTP", {
service: "Sendgrid"
, auth: {
user: config.smtp.username
, pass: config.smtp.password
}
}).sendMail({
@jlecour
jlecour / post_to_slack.rb
Last active May 22, 2022 17:43
How to post alerts from Monit to Slack
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|