Skip to content

Instantly share code, notes, and snippets.

View elboletaire's full-sized avatar
🍄
hunting mushrooms

Òscar Casajuana elboletaire

🍄
hunting mushrooms
View GitHub Profile
@famousgarkin
famousgarkin / fix.sh
Created March 18, 2017 18:10
ffmpeg fix "Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it."
ffmpeg -i "in.avi" -bsf:v mpeg4_unpack_bframes -vcodec copy "out.avi"
@niksmac
niksmac / zmv-examples.md
Created March 7, 2017 05:58
ZMV-Examples (require autoload zmv)

rename a section of a filename, i. e. example.1.{txt,conf,db} or 12345.1.{wav,ogg,mp3} and

change the 1 to a 2 in the filename while preserving the rest of it.

$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'

Rename files to lower case

$ zmv '*' '${(L)f}'

serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)

$ autoload zmv

@mattiaerre
mattiaerre / open-component-renderer.js
Last active August 20, 2017 22:45
how to client side render an OpenComponents component using the Console (Developer Tools)
((oc, $) => {
// see: https://github.com/opentable/oc/wiki/Browser-client#ocbuild-options
const html = oc.build({
baseUrl: 'http://localhost:3030',
name: 'pi-baltimore-special-offers-promo-banners',
version: '1.X.X',
parameters: {
banner: 'purple-pasta'
}
});
@reima
reima / ButtonMod.cs
Last active September 2, 2022 06:44
using ColossalFramework.UI;
using ICities;
using UnityEngine;
namespace ButtonMod
{
public class ButtonMod : IUserMod
{
public string Name { get { return "Button"; } }
public string Description { get { return "Shows a button"; } }
@willprice
willprice / .travis.yml
Last active August 15, 2023 17:12
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@rroblak
rroblak / README.md
Last active October 26, 2023 03:22
git diff image files on the command line, with color

This is a simple way to spot check that the modified image in your git index is the image you actually want without having to leave the command line.

Example: http://i.imgur.com/RUenUcM.png

Instructions

  1. Install git, ImageMagick, and jp2a via your favorite package manager.
  2. Put img-ascii-diff somewhere (e.g. ~/bin/img-ascii-diff).
  3. Put attributes in ~/.config/git/attributes.
  4. Modify ~/.gitconfig and add the lines below, pointing to wherever you put img-ascii-diff.
@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@elboletaire
elboletaire / spam-boxes.php
Last active March 13, 2019 21:57
Email spam box services array
<?php
$spam_boxes = array(
'mailinator\.com',
'6url\.com',
'dodgeit\.com',
'greensloth\.com',
'spam\.la',
'spamday\.com',
'tempinbox\.com',
@joelverhagen
joelverhagen / README.md
Created February 12, 2012 02:14
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@csanz
csanz / encrypt_decrypt.js
Created August 30, 2011 16:06
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')