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
#
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 / 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.
##