Skip to content

Instantly share code, notes, and snippets.

View colindensem's full-sized avatar
🏠
Working from home

Fynn.Codes colindensem

🏠
Working from home
View GitHub Profile
@colindensem
colindensem / Makefile
Created March 1, 2021 09:30 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
##
# Calendar helper with proper events
# http://www.cuppadev.co.uk/webdev/making-a-real-calendar-in-rails/
#
# (C) 2009 James S Urquhart (jamesu at gmail dot com)
# Derived from calendar_helper
# (C) Jeremy Voorhis, Geoffrey Grosenbach, Jarkko Laine, Tom Armitage, Bryan Larsen
# Licensed under MIT. http://www.opensource.org/licenses/mit-license.php
##
@colindensem
colindensem / README.md
Created July 27, 2020 07:14 — forked from wvengen/README.md
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@colindensem
colindensem / rspec_model_testing_template.rb
Created September 24, 2018 08:43 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@colindensem
colindensem / fresh-chrome-with-custom-tz.sh
Created February 15, 2018 09:05 — forked from prasadsilva/fresh-chrome-with-custom-tz.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@colindensem
colindensem / nanocloud.sh
Created July 26, 2017 22:11 — forked from glinton/aProxy.md
Install and use nanobox on a linux cloud box (or about any other linux box). Tested on DigitalOcean 16.04
# become root (if not already)
sudo su
# create user 'nanouser' with password 'password'
useradd -m -p papAq5PwY/QQM -s /bin/bash nanouser
# make 'nanouser' a sudoer
usermod -aG sudo nanouser
# get docker
@colindensem
colindensem / git-dmz-flow.md
Created January 12, 2017 21:09 — forked from djspiewak/git-dmz-flow.md
Git DMZ Flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@colindensem
colindensem / scheduler.ex
Created November 12, 2016 17:05 — forked from danielberkompas/scheduler.ex
A simple mix task scheduler for Elixir apps
defmodule MyApp.Scheduler do
@moduledoc """
Schedules a Mix task to be run at a given interval in milliseconds.
## Options
- `:task`: The name of the Mix task to run.
- `:args`: A list of arguments to pass to the Mix task's `run/1` function.
- `:interval`: The time interval in millisconds to rerun the task.
@colindensem
colindensem / examples.elm
Created October 10, 2016 14:59 — forked from wordyallen/examples.elm
Hello Elm
module Main exposing (..)
import Html exposing (text)
main =
text "Hello, World!"
@colindensem
colindensem / drop_many_tables.sql
Created August 18, 2016 05:24 — forked from kleinron/drop_many_tables.sql
MySQL bulk drop table where table like... See the question and the answers: http://stackoverflow.com/q/11053116/17772
SET @temp_statement = NULL;
SELECT
GROUP_CONCAT(table_schema, '.`', table_name, '`') INTO @temp_statement
FROM
(
SELECT
table_schema, table_name
FROM
information_schema.tables
WHERE