Skip to content

Instantly share code, notes, and snippets.

View sburlot's full-sized avatar

Stephan Burlot sburlot

View GitHub Profile
# !/usr/bin/env python3
# Nicolas Seriot
# 2022-06-14
# https://seriot.ch/visualization/truchet_2.png
# loosely inspired by https://www.fxhash.xyz/gentk/slug/dirty-interlaced-truchet-tiles-18
import cairo
import math
import random
# !/usr/bin/env python3
# Nicolas Seriot
# 2022-06-10
# https://seriot.ch/visualization/truchet_simple.png
import cairo
import math
import random
NB_COLS = 8
<?php
// https://en.wikipedia.org/wiki/Category:Coffee_brands
$covfefes = [
'alterracoffeeroasters',
'angiangcoffee',
'angelinus',
'autocrat',
'barcaffe',
'batdorfbronson',
'bewleys',
@size = (1920, 1080);
@center = (-.743653135, .131826563);
$zoom = .000014628;
$max_it = 700;
$oversample = 2;
$_ *= $oversample for (@size);
open $fh, "|-", "convert -size ".join("x",@size)." -depth 8 gray:- ".
"-resize ".(100/$oversample)."% mandel.png";
for $py (1 .. $size[1]) {
@sburlot
sburlot / xc_ramdisk.sh
Created March 8, 2014 15:03
Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
#!/bin/bash
# Creates a ramdisk and start Xcode with the DerivedData stored in ramdisk. Also deletes the ramdisk and reset Xcode prefs.
# xc_ramdisk.sh
# - creates a ramdisk, set Xcode DerivedData to this disk and start Xcode.
# - umount a ramdisk, set Xcode DerivedData to default
# Stephan Burlot, Coriolis Technologies, http://www.coriolis.ch
#
# based on Alex Shevchenko xcode_ramdisk.sh script (https://gist.github.com/skeeet/2367298)
# based on Diego Freniche xc-launch.sh script (https://github.com/dfreniche/xc-launch)
@neverything
neverything / .htaccess
Last active April 2, 2022 07:49
WordPress behind a reverse proxy.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /blog/
RewriteBase /~accountname/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /blog/index.php [L]
RewriteRule . /~accountname/index.php [L]
#import <Foundation/Foundation.h>
#import "sqlite3.h"
typedef int64_t timestamp;
NSUInteger randomNumberInRange(NSUInteger start, NSUInteger end);
// Create a sample date using the ISO-8601 format.
// 2013-04-23T16:29:05Z
NSString* generateSampleDate();
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@sburlot
sburlot / send_sms.php
Created December 30, 2012 14:09
PHP script to send SMS via the Infomaniak website. You need to have an account (http://www.infomaniak.ch) and add some credits to send SMS. This script was used to send sms alerts automatically, but you can use to send any sms you want (happy new year, birthday wishes, etc...)
#!/usr/bin/php
# Send SMS messages via Infomaniak.ch
# You need an Infomaniak.ch account and have some credits to send SMS
# Stephan Burlot, http://coriolis.ch Dec, 30 2012
#
<?php
// Username (your email address)
define('USER', 'user@domain.ch');
@nfarina
nfarina / UIView+FrameAdditions.h
Created August 21, 2012 06:40
UIView Frame helper getter/setter category methods
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end