Skip to content

Instantly share code, notes, and snippets.

View amarcadet's full-sized avatar

Antoine Marcadet amarcadet

View GitHub Profile
@amarcadet
amarcadet / swiftlint.schema.json
Last active January 13, 2024 20:48
swiftlint.schema.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://realm.github.io/SwiftLint/swiftlint.schema.json",
"title": "SwiftLint Configuration YAML Schema",
"type": "object",
"additionalProperties": false,
"allOf": [
{
"if": {
"required": [
@amarcadet
amarcadet / TableViewCell.h
Last active June 3, 2016 16:16
Self sizing cell with Auto Layout (ObjC and Swift)
@import UIKit;
@interface TableViewCell : UITableViewCell
+ (instancetype)cell;
+ (instancetype)cellWithOwner:(id)owner;
+ (instancetype)cellWithOwner:(id)owner options:(NSDictionary *)options;
- (CGFloat)rowHeightInTableView:(UITableView *)tableView;
@amarcadet
amarcadet / style.css
Created May 26, 2014 09:07
Reveal all the things
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
@amarcadet
amarcadet / uncrustify.cfg
Last active September 10, 2022 02:14
Uncrustify configuration
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
## Alignment
@amarcadet
amarcadet / ffmpeg_build_conf.txt
Last active December 17, 2015 00:10
Synology VideoStation Information
ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers
built on Apr 12 2013 14:42:18 with gcc 4.2.1 (GCC)
configuration: --arch=arm --target-os=linux --cross-prefix=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --enable-version3 --enable-nonfree --enable-libfaac --enable-encoders --enable-pthreads --disable-bzlib --disable-protocol=rtp --enable-muxer=mp4 --enable-avfilter --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffserver --disable-ffplay --disable-network --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-encoder=zmbv --enable-libshine --extra-libs=-lshine --enable-decoder=h264
libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 59.100 / 54. 59.100
libavformat 54. 29.104 / 54. 29.104
libavdevice 54. 2.101 / 54. 2.101
libavf
#!/bin/sh
# Find PNG images not referenced by any xib, m/h, and plist files
# Works from current directory downward.
refs=`find . -name '*.xib' -o -name '*.[mh]' -o -name '*.plist'`
for image in `find . -name '*.png'`
do
image_basename=`basename $image`
@amarcadet
amarcadet / Class.m
Last active October 12, 2015 13:08
Singleton
+ (instancetype)sharedInstance
{
static dispatch_once_t once;
static <#class#> *singleton;
dispatch_once(&once, ^{ singleton = [[<#class#> alloc] init]; });
return singleton;
}
@amarcadet
amarcadet / crush.sh
Created March 21, 2012 21:55
Shells scripts to compress/decompress optimized PNG files for iOS
if [ ! -d "crushed" ]; then
mkdir crushed
fi
if [ -d "/Applications/Xcode.app/" ]; then
# Xcode 4.3 and later
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir crushed -iphone -q *.png
else
# Previous Xcode 4.3
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir crushed -iphone -q *.png
@amarcadet
amarcadet / inner-join.sql
Created December 25, 2011 11:56
Comprendre les jointures avec MySQL
SELECT *
FROM post AS p
INNER JOIN category AS c ON p.category_id = c.category_id;
@amarcadet
amarcadet / bitly-results.json
Created December 24, 2011 17:05
GreaseMonkey tutorial : urlExpander
{
"errorCode": 0,
"errorMessage": "",
"results": {
"4s0bFQ": {
"longUrl": "http://www.epershand.net"
}
},
"statusCode": "OK"
}