Skip to content

Instantly share code, notes, and snippets.

View monkbroc's full-sized avatar

Julien Vanier monkbroc

View GitHub Profile
@monkbroc
monkbroc / Gemfile
Last active August 29, 2015 19:34
Gemfile for skill sharing app
source 'https://rubygems.org'
ruby '2.2.1'
## Servers and system ###
# Manage environment variables for development in the .env file
# Load first
gem 'dotenv-rails', :require => 'dotenv/rails-now'
gem 'rails', '4.2.3'
@monkbroc
monkbroc / particle-gdb.sh
Last active September 30, 2015 16:37
Start GDB for the Photon with symbols for all 3 parts
#!/bin/bash
READELF=arm-none-eabi-readelf
GDB=arm-none-eabi-gdb
COMMON_BUILD=~/Programming/Photon/build
PLATFORM_ID=6
LTO=
function elf {
echo $COMMON_BUILD/target/$1/platform-$PLATFORM_ID-m$LTO/$1.elf
@monkbroc
monkbroc / 50-particle.rules
Last active June 11, 2018 15:09
Udev rules for Particle devices
# UDEV Rules for Particle boards
#
# This will allow reflashing with DFU-util without using sudo
#
# The latest version of this file may be found at:
# https://gist.github.com/monkbroc/b283bb4da8c10228a61e
#
# This file must be placed at:
#
# /etc/udev/rules.d/50-particle.rules (preferred location)
@monkbroc
monkbroc / random_name.rb
Created July 5, 2015 14:44
Random thingy name generator, like pleasant_cat and smooth_duck
#!/usr/bin/env ruby
require 'highline/import'
ADJECTIVES = %w(
broad crooked curved deep even flat hilly jagged round shallow square
steep straight thick thin triangular uneven average big fat gigantic
huge large little long massive medium miniature narrow petite short
skinny small tall tiny wide cooing deafening faint harsh hissing hushed
husky loud melodic mute noisy purring quiet raspy screeching shrill
@monkbroc
monkbroc / Zend_Gdata_HttpClient.php
Created May 28, 2015 17:10
Zend 1 Gdata OAuthClient
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
@monkbroc
monkbroc / jul1.bas
Created April 23, 2015 00:10
Premier programme en QBASIC (1995)
CLS
LOCATE 12, 1: PRINT STRING$(78, 196)
X = 78
FOR A = 1 TO 40:
LOCATE 11, X: COLOR 1: PRINT CHR$(2)
LOCATE 11, X + 1: PRINT " "
FOR B = 1 TO 500
NEXT B: X = X - 1
NEXT A
LOCATE 13, 40: PRINT "JULIEN"
@monkbroc
monkbroc / maison3.bas
Created April 23, 2015 00:07
Mon premier jeu en QBASIC (1995)
CLS : LOCATE 13, 1: PRINT STRING$(79, 196): MUR = 219: C = 1: X = 1: M = 16: E = 1: F = 1: B$ = "TU AS GAGNE!"
LOCATE 1, 1: PRINT "Appuyer sur ECHAP pour quitter"
LOCATE 16, 1: PRINT "="
LOCATE 23, 1: PRINT STRING$(79, 196): LOCATE 13, 14: PRINT " ": A = 1
LOCATE 12, 1: COLOR 2: PRINT CHR$(2): C$ = "L8O3CEGO4CO3P8GO4C4"
LOCATE 11, 1: PRINT "OH NON! MAIS COMMENT DONC REVENIR A LA MAISON?"
LOCATE 11, 55: PRINT "- - - - -": LOCATE 11, 70: PRINT "�": B = 1: S = 1
LOCATE 12, 79: PRINT CHR$(127): LOCATE 12, 29: PRINT CHR$(MUR)
LOCATE 17, 28: PRINT STRING$(5, 196): LOCATE 15, 32: PRINT "-"
FOR H = 1 TO 5000: NEXT H
class RenameTeamUsersWithId < ActiveRecord::Migration
def change
rename_table :team_user_tmps, :team_users
end
end
class DropTeamsUsersWithoutId < ActiveRecord::Migration
def change
drop_table :teams_users
end
end
class CopyTeamUsers < ActiveRecord::Migration
class User < ActiveRecord::Base
has_and_belongs_to_many :teams
has_many :team_user_tmps
has_many :teams_tmp, :through => :team_user_tmps, :source => :team
end
class Team < ActiveRecord::Base
has_and_belongs_to_many :users
has_many :team_user_tmps
has_many :users_tmp, :through => :team_user_tmps, :source => :user