Skip to content

Instantly share code, notes, and snippets.

package main
import "fmt"
import "unsafe"
type TerraformResource struct {
Cloud string // 16 Bytes
Name string // 16 Bytes
PluginVersion string // 16 Bytes
TerraformVersion string // 16 Bytes
@brainwire
brainwire / gist:a1791e3cd1a34f75b93f3175eed7c3a1
Created October 18, 2021 04:45 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@brainwire
brainwire / logrotate-puma-rails
Created July 7, 2019 09:50 — forked from iamdbc/logrotate-puma-rails
logrotate for puma on rails
# file location: /etc/logrotate.d
/sitesroot/domain/logfolder/*.log {
su deploy deploy
daily
rotate 7
missingok
dateext
compress
notifempty
class LogHandler
attr_reader :successor
def initialize(successor = nil)
@successor = successor
end
def process(log_item)
if accept(log_item)
@brainwire
brainwire / README-Template.md
Created November 17, 2017 12:34 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@brainwire
brainwire / rds_to_docker.md
Created March 1, 2017 07:04 — forked from herval/rds_to_docker.md
Moving a Postgres db from RDS to a Docker container

Make a backup from RDS

pg_dump -h <rds host> -p 5432 -F c -O -U <rds user> <db name> > db.dump

Restore the backup into a Docker container

docker run --rm --interactive --link <postgres container id>:postgres --volume $PWD/:/tmp/ postgres:latest /bin/bash -c 'pg_restore --verbose --clean --no-acl --no-owner -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -d <db name> /tmp/db.dump'
@brainwire
brainwire / 00_README.md
Created February 3, 2017 09:08
development server Puma + Listen + FSEvent (macOS) : Fix running too many fsevent_watch processes
# use SSHKit directly instead of Capistrano
require 'sshkit'
require 'sshkit/dsl'
include SSHKit::DSL
# set the identifier used to used to tag our Docker images
deploy_tag = ENV['DEPLOY_TAG']
# set the name of the environment we are deploying to (e.g. staging, production, etc.)
deploy_env = ENV['DEPLOY_ENV'] || :production
@brainwire
brainwire / README.txt
Created March 23, 2016 09:45 — forked from rdetert/README.txt
Setup Monitoring for a rake ts:dd job (Thinking Sphinx Delayed Delta)
The purpose of all this is to see if sphinx, thinking sphinx and thinking sphinx delayed delta are all working properly.
I created a test controller on a separate monit subdomain that simply generates and posts a test value and then uses curl to retrieve it. If the two values match, then sphinx is working properly with delayed delta.
This example assumes a Linux installation.
The file 'delayed_delta.sh' spawns the `rake ts:dd` process in the background, saving its PID to tmp/pids in your Rails project. You can start and stop it by running '/etc/init.d/delayed_delta.sh start' and '/etc/init.d/delayed_delta.sh stop'. You will use these in your monitoring to, see the monitrc snippet.
In a crontab, every X seconds or minutes, run 'ar_sphinx_mon.sh' to see if records are properly being inserted and indexed. If they aren't, then kill all Thinking Sphinx processes and monit should restart them.
@brainwire
brainwire / leaflet-foursquare.js
Created March 21, 2016 15:29 — forked from missinglink/leaflet-foursquare.js
Leaflet configuration which allows you to set map co-ordinates with a pixel offset (as per foursquare homepage). In this example I am using jQuery to find the width of `$('main.content')` and use that to offset the map.
var map = L.map( 'map' );
L.Map.prototype.panToOffset = function (latlng, offset, options) {
var x = this.latLngToContainerPoint(latlng).x - offset[0]
var y = this.latLngToContainerPoint(latlng).y - offset[1]
var point = this.containerPointToLatLng([x, y])
return this.setView(point, this._zoom, { pan: options })
}
function centerMap(){