Skip to content

Instantly share code, notes, and snippets.

Alexandre Fruchaud mmacphail

Block or report user

Report or block mmacphail

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:67dee2c813c6a1d3e27c7b6ea2955b8e
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
View gist:5e81e951f876611a16b7a0884e7418a7
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@mmacphail
mmacphail / Guesser.kt
Last active Aug 19, 2019
FP to the max implemented with Arrow
View Guesser.kt
package eu.macphail.guesser
import arrow.Kind
import arrow.core.*
import arrow.effects.*
import arrow.extension
import eu.macphail.guesser.io.console.console
import eu.macphail.guesser.io.program.program
import eu.macphail.guesser.io.randomNumberGen.randomNumberGen
import kotlin.random.Random
@mmacphail
mmacphail / gist:9dab9ae0196d3c4904583cabf7e872b2
Created Jan 15, 2019
Recursively convert all windows file to unix format
View gist:9dab9ae0196d3c4904583cabf7e872b2
find . -type f -print0 | xargs -0 dos2unix
View gist:b32e3f022d0d5a0dbf176f3d46d4289e
https://www.tigerteam.dk/2014/micro-services-its-not-only-the-size-that-matters-its-also-how-you-use-them-part-1/
@mmacphail
mmacphail / gist:cd63fd52a86742577d39deda0403e856
Last active Dec 20, 2017
Remove a table from SQL Server and remap user
View gist:cd63fd52a86742577d39deda0403e856
use master
ALTER DATABASE [db] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
IF EXISTS (SELECT * FROM sysdatabases WHERE name=N'db' ) DROP DATABASE [db]
create database db
use elis_work
create user user from login user
exec sp_addrolemember 'db_owner', 'user'
@mmacphail
mmacphail / cipher.hs
Last active Dec 18, 2017
Caesar Cipher with Haskell
View cipher.hs
module Cipher where
import Data.Char
import Data.List (elemIndex)
cChar :: Int -> Char -> Char
cChar shift c = case c `elemIndex` range of
Just index -> if shift < 0
then ((cycle . reverse) range) !! (25 + rShift - index)
else (cycle range) !! (index + shift)
@mmacphail
mmacphail / datomic.service
Created Sep 16, 2017
Create datomic as a service on centos
View datomic.service
[Unit]
Description=datomic Service
After=network.target
[Service]
Type=simple
User=datomic
ExecStart=/var/lib/datomic/datomic-free-0.9.5561.56/bin/transactor -Xms400m -Xmx400m /var/lib/datomic/datomic-free-0.9.5561.56/bin/transactor.properties
Restart=on-abort
View gist:de61b71ddce662ac17f28ed95a98e4a5
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic-pro -Dfile=datomic-pro-0.9.5394.jar -DpomFile=pom.xml
@mmacphail
mmacphail / gist:ba448c074d7c90719e6c799c473b94f6
Created Aug 7, 2017
Ecrire directement dans les logs IS depuis les services java
View gist:ba448c074d7c90719e6c799c473b94f6
com.wm.util.JournalLogger.log(3,90,3," votre message");
You can’t perform that action at this time.