Skip to content

Instantly share code, notes, and snippets.

import UIKit
extension UIImage {
// colorize image with given tint color
// this is similar to Photoshop's "Color" layer blend mode
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved
// white will stay white and black will stay black as the lightness of the image is preserved
func tint(tintColor: UIColor) -> UIImage {
@ymauray
ymauray / xcode-build-bump.sh
Created August 18, 2017 18:29 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@ymauray
ymauray / usefull-git-commands-and-workflow.md
Created December 12, 2017 09:34
Usefull git commands and workflow

Usefull git commands and workflow

Set "vi" as the default editor

git config --global core.editor "vi"

Prepare a branch to work on fixes (assuming master is always a clone of upstream/master) :

Il faut rester dans des résolutions standard

VBoxManage setextradata "vboxname" VBoxInternal2/EfiHorizontalResolution 1600
VBoxManage setextradata "vboxname" VBoxInternal2/EfiVerticalResolution 900
country=ch
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="MaBoxInternet"
psk="ClefSecurite"
}
@ymauray
ymauray / code-server.conf
Last active March 8, 2019 12:01
Apache 2 config file to act as a reverse proxy for Visual Studio Code on the server
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName code.somehost.ch
ProxyRequests Off
AllowEncodedSlashes NoDecode
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:8443/$1 [P,L]
@ymauray
ymauray / code-server.service
Created March 8, 2019 10:34
systemd startup script for Visual Studio Code on the server
[Unit]
Description=Visual Studio Code on the server
After=network.target
[Service]
ExecStart=/usr/bin/code-server --allow-http /home/someuser/workspace/ --password=somefixedpassword
User=someuser
Restart=always
RestartSec=1
@ymauray
ymauray / procedure.md
Last active December 6, 2019 12:40
TemplaVoila problem - Procedure

Create a mysql database :

create database typo3 default character set 'utf8mb4' default collate 'utf8mb4_general_ci';
create user 'typo3'@'localhost' identified by 'typo3';
grant all privileges on typo3.* to 'typo3'@'localhost';
flush privileges;

Install Typo3 and TemplaVoila

@ymauray
ymauray / calf_config.xml
Last active April 23, 2020 15:00
Script to start JACK, load Calf JACK Host, connect ports, wait, and kill jack.
<?xml version="1.1" encoding="utf-8"?>
<rack><plugin type="gate" instance-name="gate" input-index="1" output-index="1">
<preset bank="0" program="0" plugin="gate" name="">
<param name="bypass" value="0" />
<param name="level_in" value="1" />
<param name="meter_in" value="0.315075" />
<param name="meter_out" value="0.315075" />
<param name="clip_in" value="0" />
<param name="clip_out" value="0" />
<param name="range" value="1.5849e-05" />
@ymauray
ymauray / show_server_names.sh
Last active February 26, 2021 09:35
Get a list of "server_name" an nginx server knows about (FreeBSD version, using gsed)
#!/bin/bash
sudo nginx -T 2>/dev/null \
| gsed -r -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' -e 's/^#.*$//' -e 's/[[:space:]]*#.*$//' -e '/^$/d' \
| gsed -e ':a;N;$!ba;s/\([^;\{\}]\)\n/\1 /g' \
| grep 'server_name[[:space:]]' \
| grep -v '\$' \
| grep '\.' \
| gsed -r -e 's/(\S)[[:space:]]+(\S)/\1\n\2/g' -e 's/;//' \
| grep -v "^server_name$" \