Skip to content

Instantly share code, notes, and snippets.

View fanf's full-sized avatar

François Armand fanf

View GitHub Profile
/**
* Description of Unix file permissions DSL
* Only user", "group" and "other" (whitout setuid,
* setgid and sticky bit) permission are managed.
*
* The goal of these classes is to make their
* use as near as possible as Unix chmod, but in
* Scala.
*
* ## First, Perm objects: simple
package net.liftweb.http
import net.liftweb.common._
/**
* That class allow to load and register a snippet for the context of
* a Lift request.
*
*
* Such snippet should not be reachable directly from the application,
import scala.xml._
import net.liftweb.http.js._
import JsCmds._
import JE._
import net.liftweb.util.Helpers._
/**
* Extract JS from a NodeSeq
* Useful when using Lift SetHtml/Replace and it doesn't run the embedeed JS
*
@fanf
fanf / update-all-branche-2.3.zsh
Created November 28, 2011 10:31
Update all dev projects of Rudder on branch master or 2.3
#!/bin/zsh
BASE="/path/to/rudder-project/root"
REPOS="rudder-parent-pom rudder-commons scala-ldap ldap-inventory cf-clerk rudder rudder-policy-templates"
for i in $(echo ${REPOS})
do
P=${BASE}/${i}
echo "\e[0;32mUpdating ${P}\e[0m"
cd ${P}
@fanf
fanf / update-all-master.zsh
Created February 2, 2012 10:23
A script to update all git master for Rudder Scala projects
#!/bin/zsh
#
# Save that file on the directory that contains all you Rudder projects.
# The script fetch all project's origin, checkout master and pull origin/master.
# Before using it, be sure to have commited all you modifications !
#
#change base to the path to the
BASE="/path/to/the/root/rudder-project"
This file has been truncated, but you can view the full file.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building scala-ldap 2.6.0-scala_2.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ scala-ldap ---
[INFO] Deleting /home/fanf/java/workspaces/rudder-project/scala-ldap/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ scala-ldap ---
This file has been truncated, but you can view the full file.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building scala-ldap 2.6.0-scala_2.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ scala-ldap ---
[INFO] Deleting /home/fanf/java/workspaces/rudder-project/scala-ldap/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ scala-ldap ---
7777950 137 $anon$1 com.normation.ldap.ldif.Slf4jLDIFLogger$class.fileName source-/home/fanf/java/workspaces/rudder-project/scala-ldap/src/main/scala/com/normation/ldap/ldif/LDIFFileLogger.scala,line-114,offset=3359
7778548 932 ClassfileLoader java.util.Comparator NoPosition
7792344 824 ClassfileLoader scala.collection.parallel.mutable.package NoPosition
7793190 8 LazyTypeRef scala.collection.parallel.mutable.package NoPosition
7793210 34 LazyTypeRef scala.collection.parallel.mutable.package NoPosition
7791429 1878 PackageLoader scala.collection.parallel.mutable NoPosition
7791321 2027 LazyTypeRef scala.collection.mutable.ArrayOps NoPosition
@fanf
fanf / DependencyInjection.scala
Created July 18, 2013 16:06
Simple, Static Scala dependency injection with Shapeless
package test_shapeless
object DI {
import shapeless._
trait Injecter[L <: HList, A] {
def apply(l: L) : A
}
trait InjecterAux[L <: HList, A] {
@fanf
fanf / .vimrc_gpg_handling
Last active October 16, 2023 20:37
vimrc config to auto decrypt/encrypt .gpg files
" GPG config
" Don't save backups of *.gpg files
set backupskip+=*.gpg
" To avoid that parts of the file is saved to .viminfo when yanking or
" deleting, empty the 'viminfo' option.
set viminfo=
augroup encrypted
au!
" Disable swap files, and set binary file format before reading the file