Skip to content

Instantly share code, notes, and snippets.

View mickaelperrin's full-sized avatar

Mickaël PERRIN mickaelperrin

  • dkod
  • Toulon, France
View GitHub Profile
@mickaelperrin
mickaelperrin / generate_pydio_hash.php
Created August 14, 2015 17:28
Pydio : create sha256 hash
<?php
$user = 'admin';
$password ='password';
/**********************************************************************/
define("PBKDF2_HASH_ALGORITHM", "sha256");
define("PBKDF2_ITERATIONS", 1000);
define("PBKDF2_SALT_BYTE_SIZE", 24);
@mickaelperrin
mickaelperrin / keybindings
Created May 4, 2016 22:30
kwm configuration
// Enable the prefix mode
kwmc mode prefix prefix on
kwmc mode prefix timeout 0.75
kwmc mode prefix restore default
kwmc mode prefix color dd00ff00
//####### Default Keybinds ########
// Activate prefix mode
kwmc bindsym ctrl-s mode activate prefix
@mickaelperrin
mickaelperrin / Dockerfile
Last active July 8, 2016 13:11
Patch for composer to use temporary folder when extracting packages
# Setup the Composer installer with a patch to exclude temp files / folders to be sync with lsyncd
COPY ./composer.patch /tmp
RUN php -r "readfile('https://getcomposer.org/installer');" > /tmp/composer-setup.php \
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot && rm -rf /tmp/composer-setup.php \
&& git clone https://github.com/composer/composer.git /tmp/composer \
&& cd /tmp/composer \
&& composer install \
&& mv /tmp/composer.patch /tmp/composer \
&& cd /tmp/composer \
@mickaelperrin
mickaelperrin / test.php
Created August 10, 2016 13:30
Size of file downloaded on Github differs from headers with PHP and protocol 1.1
<?php
//Smaller file 1M: $test_url = 'https://github.com/mickaelperrin/phantomJS/releases/download/2.1.1/file.txt.bz2';
$test_url = 'https://github.com/medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2';
function test_result($result, $http_response_header) {
$result_content_length = strlen($result);
$header_content_length = null;
foreach ($http_response_header as $header) {
if (preg_match('{^content-length:\s*(.+?)\s*$}i', $header, $match)) {
@mickaelperrin
mickaelperrin / README.md
Created August 17, 2016 19:56 — forked from cueedee/README.md
Yeoman generator mixin method for generating symbolic links.

Your generator could mixin the symLink() method like so:

'use strict';

var generators      = require( 'yeoman-generator' )
,   _               = require( 'lodash' )
;

var MyGenerator = generators.Base.extend(
@mickaelperrin
mickaelperrin / actionlist.vim
Created September 24, 2016 16:16 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@mickaelperrin
mickaelperrin / .chunkwmrc
Created August 18, 2017 12:43
chunkwm configuration
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir ~/.chunkwm_plugins
#
@mickaelperrin
mickaelperrin / initMac.sh
Created October 6, 2017 10:04 — forked from florianrusch/initMac.sh
Init Mac file
#/bin/sh
#
# Reasonably sets OS X defaults. My sources:
# - https://ss64.com/osx/syntax-defaults.html
# - https://github.com/nicksp/dotfiles/blob/master/osx/set-defaults.sh
# - https://github.com/mathiasbynens/dotfiles/blob/master/.macos
#
@mickaelperrin
mickaelperrin / default.conf
Last active February 27, 2019 09:41
Create docker registry proxy for gitlab.com (proxifies myregistry.mydomain.tlf/myimage to registry.gitlab.com/mygitlabproject/myimage)
server {
listen 80;
server_name registry.docker;
set $vendor your_gitlab_vendor_name;
# Prevent infinite loop of redirects
location /v2/$vendor/ {
proxy_pass https://registry.gitlab.com;
}
@mickaelperrin
mickaelperrin / README.md
Last active November 27, 2023 16:31
1Password login / logout helper

Session sharing across terminals for 1Password

This script intends to improve usability of 1Password CLI when working with multiple sessions and.or terminals

How to use ?

Login

oplogin