Skip to content

Instantly share code, notes, and snippets.

View cpjolicoeur's full-sized avatar

Craig P Jolicoeur cpjolicoeur

View GitHub Profile
@jefflarkin
jefflarkin / printer.cfg
Last active April 12, 2024 13:44
Klipper Config
#
# Klipper configuration file for Anycubic i3 MEGA S
#
# This config file contains settings of all printer pins (steppers, sensors) for Anycubic i3 mega S with TMC2208 Drivers with stock plug orientation
# Klipper firmware should be compiled for the atmega2560
#
# Config file includes
# - Original or 2208(2209) rotated by cable drivers
# - Mesh bed leveling: BLtouch (3DTouch sensor from Triangelab)
# - Manual meshed bed leveling (commented out)
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@wosephjeber
wosephjeber / instructions.md
Last active March 27, 2024 10:52
Ecto migration for renaming table with indexes and constraints

Renaming table in Ecto migration

I recently wanted to rename a model and its postgres table in a Phoenix app. Renaming the table was simple and documented, but the table also had constraints, sequences, and indexes that needed to be updated in order for the Ecto model to be able to rely on default naming conventions. I couldn't find any examples of what this would look like but was eventually able to figure it out. For anyone else in the same situation, hopefully this example helps.

In the example below, I'm renaming the Permission model to Membership. This model belongs to a User and an Account, so it has foreign key constraints that need to be renamed.

defmodule MyApp.Repo.Migrations.RenamePermissionsToMemberships do
  use Ecto.Migration
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@jatcwang
jatcwang / gist:ae3b7019f219b8cdc6798329108c9aee
Created February 2, 2017 23:44
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@bpierre
bpierre / README.md
Last active February 15, 2024 18:40
Switch To Vim For Good

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

# -*- mode: haproxy -*-
# vi: set ft=haproxy :
defaults
log global
mode http
option forwardfor
option dontlognull
option redispatch
option http-server-close
@aesnyder
aesnyder / .tigrc
Created February 7, 2014 14:45
Mojo .Tigrc
bind generic f !@git fetch
bind generic p !@git pull
bind generic P !@git push
bind generic { !?git push -f
bind generic r !git rebase -i master
bind generic U !@git up
bind generic M !@git checkout master
bind generic ! !@git reset HEAD^
bind generic @ !@?git reset --hard HEAD^
bind generic a !git commit --amend
@kenrett
kenrett / Selenium Cheat Sheet.md
Last active May 25, 2023 01:28
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@stephanvd
stephanvd / multifact_sum_aggregator.js
Created October 31, 2013 09:33
Aggregate over multiple fact fields. Result looks like this: http://imgur.com/fI636rq The aggregator returns first field for renderers without multifield support. The renderer is a modified version of the built-in table to support multifield. Quick and dirty but it gets the job done. For https://github.com/nicolaskruchten/pivottable.
multifactSumAggregator = function() {
return function(facts) {
return function() {
var summedFacts = {};
for (_i = 0, _len = facts.length; _i < _len; _i++) {
summedFacts[facts[_i]] = 0
}