Skip to content

Instantly share code, notes, and snippets.

View kbrown's full-sized avatar

Kevin Brown kbrown

View GitHub Profile
steps:
- name: 'gcr.io/cloud-builders/git'
entrypoint: /bin/bash
args:
- -c
- |
git fetch --depth=2 origin main
echo hello
git log
@yatsu
yatsu / pyenv-python38-macos.sh
Created January 2, 2021 11:35
Install Python 3.8.6 with pyenv on macOS Big Sur (11)
#!/bin/sh
# 1) Install Xcode 12
# 2) Install command line tools: `xcode-select --install`
# 3) Install Homebrew
# 4) brew install zlib bzip2 xz
CFLAGS="-I$(brew --prefix zlib)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix xz)/include" \
LDFLAGS="-L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix xz)/lib" \
pyenv install 3.8.6

Using Elixir releases and multi-stage Docker files to simplify Phoenix deployment

This repo is my experiment in deploying a basic Phoenix app using the release feature from elixir 1.9 (https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-released/) and docker, via a multi-stage Dockerfile (https://docs.docker.com/develop/develop-images/multistage-build/) leveraging bitwalker's docker images for Elixir and Phoenix.

Step 1: Install Elixir 1.9.1 (and Erlang)

The simplest way to manage Elixir versions is to use asdf.

@aleofreddi
aleofreddi / cognito_get_all_users.sh
Last active September 20, 2024 16:13
AWS Cognito: list all users
#!/bin/sh
#
# Dump AWS Cognito users as CSV output.
#
# Thu Jun 20 15:31:10 CEST 2019, Andrea Leofreddi
#
me="`basename $0`"
if [ $# != 1 ]; then
echo Usage: "$me" pool_id >&2
@ericelliott
ericelliott / Login.js
Created July 14, 2016 04:09
Auth0 Login.js
import React, { PropTypes as T } from 'react'
import {ButtonToolbar, Button} from 'react-bootstrap'
import AuthService from 'utils/AuthService'
import styles from './styles.module.css'
export class Login extends React.Component {
static contextTypes = {
router: T.object
}
@ericelliott
ericelliott / AuthService.js
Created July 14, 2016 03:44
Auth0 AuthService.js
import { EventEmitter } from 'events'
import { isTokenExpired } from './jwtHelper'
import Auth0LockPasswordless from 'auth0-lock-passwordless';
export default class AuthService extends EventEmitter {
constructor(clientId, domain) {
super()
// Configure Auth0 Passwordless
// We’ll get the clientId and domain credentials from our .env file we created
this.lock = new Auth0LockPasswordless(clientId, domain)
@yunano
yunano / consul.service
Created May 1, 2015 15:52
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
@apollolm
apollolm / nginx-ssl-config
Last active January 12, 2023 14:47
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@berstend
berstend / LinkedOut.js
Last active November 29, 2024 12:39
Withdraw all pending invitations from LinkedIn automatically in bulk. - Or "How I stopped spamming all of my contacts with invitations". This script is super ugly (like what LinkedIn does with your email data) but worked for me. Usage: - Go to https://www.linkedin.com/inbox/invitations/sent - Open DevInspector, paste the script to the console, h…
var INCR = 16; // Number of messages per page
var SENT_URL = '//www.linkedin.com/inbox/invitations/sent?startRow=';
var loMessageLinks = []; // Main array for all contacts
var fetchMessages = function(i, cb) {
console.log('Fetching message page #' + (i+1));
$.get(SENT_URL + (i*INCR), function(data){
var $dom = $(data);
@jookyboi
jookyboi / README.md
Created March 30, 2013 01:11
Example using the marked.js README

marked

A full-featured markdown parser and compiler, written in javascript. Built for speed.

Benchmarks

node v0.4.x

$ node test --bench