Skip to content

Instantly share code, notes, and snippets.

@yuetyeelo2855
yuetyeelo2855 / docker-compose.yml
Created December 17, 2016 02:55
Example docker-compose.yml of Nginx Proxy with Let's Encrypt
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
privileged: true
ports:
- 80:80
- 443:443
volumes:
- ./nginx-proxy/certs:/etc/nginx/certs:ro
- ./nginx-proxy/htpasswd:/etc/nginx/htpasswd
@nebiros
nebiros / gist:9196645
Last active January 8, 2019 05:10
Send Push Notifications from node.js with Parse.com SDK
var Parse = require("parse").Parse;
Parse.initialize(
"", // applicationId
"", // javaScriptKey
"" // masterKey
);
var query = new Parse.Query(Parse.Installation)
, data = {
@JJediny
JJediny / Jenkinsfile
Created February 22, 2017 20:17 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@bdiegel
bdiegel / android_maps_mylocation_button.md
Last active October 6, 2021 18:05
Android Maps v2 MyLocation Button Position

Change MyLocation button position

It's easy to enable Zoom and MyLocation buttons but annoying to change where they overlay the Map.

Options

  1. Use Map padding (are that will not overlap map controls)
  2. Disable them and implement your own (probably safer than hack below)
  3. Find the buttons by id and alter the layout params

Resources:

@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@dethi
dethi / unused-files.sh
Last active April 25, 2022 05:34
create-react-app: find files not used in the app bundle, i.e. unused source code
#!/bin/bash
# Launch inside a create-react-app project after building the production build.
# Require `jq`.
diff \
<(find src -type f \( -name '*.js' -o -name '*.jsx' -o -name '*.css' \) | sort) \
<(cat build/**/*.map | jq --raw-output '.sources | join("\n")' \
| grep -v '\.\./' | grep -E '\.(js|jsx|css)$' \
| sed "s#^#src/#" | sort | uniq) \
@maxbeatty
maxbeatty / lambda.js
Created August 22, 2017 20:01
using node-postgres (`pg`) in AWS Lambda
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
});
@aurelijusrozenas
aurelijusrozenas / docker-psi
Last active August 16, 2022 16:05
Displays docker ps list with additional column of IP address.
#!/bin/bash
# Displays docker ps list with additional column of IP address.
(
# take default docker ps output
docker ps "$@" | while read -r line; do
# replace separators with | to use later with `column`
echo -n "$line" | sed 's/ \{2,\}/|/g' | tr '\t' '|';
containerId=$(echo $line | column | awk '{print $1}')
# header
if [ $containerId == 'CONTAINER' ]; then
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software