Skip to content

Instantly share code, notes, and snippets.

@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:

@AlexandreRangel
AlexandreRangel / OSC_C_01.rb
Last active April 8, 2019 10:40
Controling Sonic Pi from Processing OSC
# reading OSC from Processing, Alexandre Enkerli
# full screen, fulltime mouse, Alexandre Rangel
# 24-Nov-2016
# Sonic Pi 2.11
use_bpm 120
set_sched_ahead_time! 0 # Setting that one to a negative value makes Sonic Pi complain, it sounds like.
live_loop :osc do # The loop is inside the fx as this is where the action will be.
osc=sync "/osc" # The OSC message which Processing sends, based on mouse coordinates.
@jmshal
jmshal / create-multi-host-swarm-digitalocean.sh
Last active March 16, 2023 13:22
Setup a Docker Swarm multi-host cluster on DigitalOcean
docker-machine create \
--driver=digitalocean \
--digitalocean-access-token=$DO_TOKEN \
--digitalocean-size=512mb \
--digitalocean-region=nyc3 \
--digitalocean-private-networking=true \
--digitalocean-image=ubuntu-15-04-x64 \
docker-swarm-kv-store
docker $(docker-machine config docker-swarm-kv-store) run -d \
@SpiritLevel
SpiritLevel / silverstripe-mode.el
Last active August 5, 2019 05:45
SilverStripe mode for Emacs
;; Taken from https://gist.github.com/mmichelli/1062600
;; replace html-mode with web-mode in line 4 to get more web-mode like behaviour
(define-derived-mode silverstripe-mode html-mode "Silverstripe"
(font-lock-add-keywords
nil
'(
("\\(<% \\| %>\\)" 1 font-lock-keyword-face)
("\\(\\(if\\|else\\|control\\|cacheblock\\|Level\\|end_[a-zA-Z1-9_\.]*\\|include\\)+\\)\\>" 1 font-lock-function-name-face)
@maxpowa
maxpowa / simple_disconnect.cpp
Last active August 8, 2022 22:30
simple_disconnect module for znc 1.6+
/*
* Copyright (C) 2004-2015 ZNC, see the NOTICE file for details.
*
* 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
@Shchvova
Shchvova / CMakeLists.txt
Last active January 3, 2017 04:49
Simple Lua + C++ template
cmake_minimum_required(VERSION 2.8.4)
project(clue)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/")
include("lua.cmake")
set(SOURCE_FILES main.cpp)
add_executable(clue ${SOURCE_FILES})
@tegansnyder
tegansnyder / debugging reindex locks mysql commands.md
Created December 2, 2014 23:57
Useful Mysql Commands for Debugging Magento Reindex Locks

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

@gcpantazis
gcpantazis / deploy.sh
Created June 12, 2014 21:57
Drone setup for deploying every branch to Dokku
#!/bin/bash
if [ $DRONE_BRANCH ]; then
git fetch --unshallow
git remote remove dokku
git remote add dokku dokku@foo.dokkuhost.com:project-bar-$DRONE_BRANCH
git push dokku $DRONE_BRANCH:master
fi
@rrosiek
rrosiek / install_mysql.sh
Last active June 5, 2023 07:08
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
https://papertrailapp.com/systems/setup
# sudo sh
# cd /etc
# wget https://papertrailapp.com/tools/syslog.papertrail.crt
# yum install rsyslog-gnutls