Skip to content

Instantly share code, notes, and snippets.

View MasseGuillaume's full-sized avatar

Guillaume Massé (马赛卫) MasseGuillaume

  • narrative.io
  • Montréal, Québec, Canada
  • 20:31 (UTC -04:00)
View GitHub Profile
@MasseGuillaume
MasseGuillaume / ttfi2.scala
Last active August 29, 2015 14:14
ttfi abstracted over Numeric
trait Repr[T]
trait ExpSym[Num, repr[_]] {
def lit: Num => repr[Num]
def neg: repr[Num] => repr[Num]
def add: repr[Num] => repr[Num] => repr[Num]
}
trait MulSym[Num, repr[_]] {
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
import scalaz.Monoid
import scala.language.higherKinds
import scalaz.syntax.monoid._
import scalaz.std.set._
implicit def mm[K, T, M[_]](implicit mo: Monoid[M[T]]): Monoid[Map[K, M[T]]] = new Monoid[Map[K, M[T]]] {
def zero = Map.empty
def append(m1: Map[K, M[T]], m2: => Map[K, M[T]]) = {
val mMin = List(m1, m2).minBy(_.size)
@MasseGuillaume
MasseGuillaume / PKGBUILD
Created March 25, 2015 20:49
apache-spark 1.3.0
# Maintainer: Franois Garillot ("huitseeker") <francois [at] garillot.net>
# Contributor: Christian Krause ("wookietreiber") <kizkizzbangbang@gmail.com>
pkgname=apache-spark
pkgver=1.3.0
pkgrel=3
pkgdesc="fast and general engine for large-scale data processing"
arch=('any')
url="http://spark.apache.org"
license=('APACHE')
@MasseGuillaume
MasseGuillaume / bootstrap.sh
Last active August 29, 2015 14:22
Mediative Bootstrap
#!/bin/sh
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
brew cask install google-chrome
brew cask install sublime-text3
HN: hyphothesis
AN: Axioms/Rules
H1: most minners uses top hardware 5 [TH/s] at 3600 [W] (best case)
source: https://en.bitcoin.it/wiki/Mining_hardware_comparison
H2: at ~5 [TH/s] it's expected to generate 0.05 [BTC/d]
source: https://alloscomp.com/bitcoin/calculator
A1: rule: 25 BTC/block
@MasseGuillaume
MasseGuillaume / wpa_supplicant.conf
Created July 21, 2015 21:07
udem wpa_supplicant.conf
network={
ssid="UdeM avec cryptage"
scan_ssid=1
key_mgmt=WPA-EAP NONE
pairwise=CCMP
group=CCMP TKIP
eap=TTLS PEAP TLS
identity="_____________@umontreal.ca" # << TODO
password="_____________" # << TODO
ca_cert="/etc/ssl/certs/ca-bundle.crt" # << TODO
@MasseGuillaume
MasseGuillaume / test.sh
Created April 26, 2012 15:52
log1000 correction tp4
#! /bin/sh
SOURCE=tictactoe.cpp
SOURCE_TMP=tmp_tictactoe.cpp
DIFF_FAIL="ok"
COMPILE_FAIL="ok"
cp $SOURCE $SOURCE_TMP
#test patches
for diff in *.diff
@MasseGuillaume
MasseGuillaume / Radio.cpp
Created April 26, 2012 15:51
Loop audio with FMOD
void Radio::playTrack( string fileTrack )
{
systeme_->createStream( fileTrack.c_str(), FMOD_ACCURATETIME, false, &sound_ );
systeme_->playSound( FMOD_CHANNEL_FREE, sonRadio_, false, &channel_ );
}
void Radio::update()
{
bool playing = false;
if( channel_ ->isPlaying(&playing) != FMOD_OK )
@MasseGuillaume
MasseGuillaume / P06.scala
Created May 23, 2012 02:34
Scala Kata: Test & Implementation
// source: http://aperiodic.net/phil/scala/s-99/
def isPalindrome[A](in: List[A]):Boolean = in == in.reverse
// source: https://github.com/dadrox/scala.katas (adapted for spec2)
import org.junit._
import org.specs2.matcher._
class NinetyNineScalaProblems extends JUnitMustMatchers {
@test def P06
{
isPalindrome Nil must beTrue