Skip to content

Instantly share code, notes, and snippets.

View matinfo's full-sized avatar

Mathieu Meylan matinfo

  • Switzerland
View GitHub Profile
@matinfo
matinfo / SDImage.sh
Created April 13, 2024 15:57 — forked from chatchavan/SDImage.sh
Create a disk image from an SD card and write the disk image to another SD card (Mac OS X)
#!/bin/bash
### NOTE
# Ideally, you should create an image from small partition (e.g., 4 GB) instead of the whole SD card (e.g., 32 GB).
# For example, an image for Raspbian image should be created by the following procdure:
# (1) Install the official Raspbian image (3.5 GB for Jessie) on an SD card
# (2) Manually expand the partition to a modest size to accommodate your base software (e.g., 4 GB)
# (3) Perform apt-get update and upgrade, install software and configuration that you want.
# (4) Create an image from that (4 GB) partition
#
@matinfo
matinfo / App.vue
Last active July 20, 2018 13:55
RedactorEditor.vue
import Vue from 'vue'
import VeeValidate from 'vee-validate'
...
import RedactorEditor from './components/RedactorEditor.vue'
Vue.use(VeeValidate)
Vue.component('select2', {
props: ['options', 'value'],
template: `
<div>
<select multiple ref='select'>
<slot></slot>
</select>
</div>
`,
mounted: function () {
@matinfo
matinfo / encoding-video.md
Created January 25, 2018 14:15 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@matinfo
matinfo / magento_url_rewrite.patch
Created November 16, 2017 09:57 — forked from edannenberg/magento_url_rewrite.patch
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
@matinfo
matinfo / gist:96747456aab36ea34c2681433a2f594c
Created October 15, 2016 15:09
Handel max char left control for input and textarea with angularJS directive
// Handel max char left control for input and textarea
/* Set on your project this minumum css style (adapt for your need)
* mandatory for directive *maxlength-control*
*/
/*
.maxlength-control ~ .maxlength-control-status {
color: #b5b5b5;
float: right;
@matinfo
matinfo / app.js
Created June 16, 2016 14:19 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@matinfo
matinfo / magento-code-snippets.md
Created April 13, 2016 09:23 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@matinfo
matinfo / redis_
Last active September 11, 2015 09:47 — forked from colinmollenhour/redis_
Munin plugin for Redis with added options
#!/usr/bin/perl -w
#
## Copyright (C) 2011 Colin Mollenhour <http://colin.mollenhour.com/>
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; version 2 dated June,
## 1991.
##
@matinfo
matinfo / 1_virtualenv_gems_install.env
Last active August 29, 2015 14:02
Virtualenv Ruby install gems script from requirement_gems.txt
# add first to your virtualenv (postactivate or autoenv, etc)
export GEM_HOME="$VIRTUAL_ENV/gems"
export GEM_PATH=""
export PATH=$PATH:"$GEM_HOME/bin"