Skip to content

Instantly share code, notes, and snippets.

View alessandrostone's full-sized avatar

Alessandro Aresta alessandrostone

View GitHub Profile
@ericallam
ericallam / AppDelegate.m
Created May 22, 2014 14:49
Interactive Animated Transition Example
//
// AppDelegate.m
// AnimationExamplesiPhone
//
// Created by Eric Allam on 10/05/2014.
#import "AppDelegate.h"
#pragma mark - UIColor Additions
@unhammer
unhammer / progress.sh
Last active April 13, 2023 14:41
Show progress of some command you forgot to pipe through pv
#!/bin/bash
### Save as "/usr/local/bin/progress" and chmod +x, then:
#
# $ progress ~/huge-file.tar.bz2
# $ progress -p $(pidof bzcat)
# $ progress # progress of all open files, shows e.g. how far mpd is through your song :P
#
# source: http://stackoverflow.com/a/238140/69663
@t-mat
t-mat / minimal_vst2x_host.cpp
Last active June 7, 2024 06:22
WIN32 : Minimal VST 2.x host in C++11.
// Win32 : Minimal VST 2.x Synth host in C++11.
//
// This is a simplified version of the following project by hotwatermorning :
// A sample VST Host Application for C++ Advent Calendar 2013 5th day.
// https://github.com/hotwatermorning/VstHostDemo
//
// Usage :
// 1. Compile & Run this program.
// 2. Select your VST Synth DLL.
// 3. Press QWERTY, ZXCV, etc.

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@sakrist
sakrist / gist:f97499de2dd6687d6403
Last active April 22, 2020 06:40
Objective-C Language Enhancements

Objective-C APIs can now express the “nullability” of parameters, return types, properties, variables, etc. For example, here is the expression of nullability for several UITableView APIs:

-(void)registerNib:(nonnull UINib *)nib forCellReuseIdentifier:(nonnull NSString *)identifier;
-(nullable UITableViewCell *)cellForRowAtIndexPath:(nonnull NSIndexPath)indexPath;
@property (nonatomic, readwrite, retain, nullable) UIView *backgroundView;

The nullability qualifiers affect the optionality of the Objective-C APIs when in Swift. Instead of being imported as implicitly-unwrapped optionals (e.g., UINib!), nonnull-qualified types are imported as non-optional (e.g., UINib) and nullable-qualified types are imported as optional (e.g., UITableViewCell?), so the above APIs will be seen in Swift as:

func registerNib(nib: UINib, forCellReuseIdentifier identifier: String)
@junegunn
junegunn / b.rb
Last active January 26, 2023 14:34
b - browse Chrome bookmarks with fzf
#!/usr/bin/env bash
# vim: set filetype=ruby:
# b - browse Chrome bookmarks with fzf
[ $(uname) = Darwin ] || exit 1
which fzf > /dev/null 2>&1 || brew reinstall --HEAD fzf || exit 1
/usr/bin/ruby -x "$0" |
fzf-tmux -u 30% --ansi --multi --no-hscroll --tiebreak=begin |
awk 'BEGIN { FS = "\t" } { print $2 }' |
@subfuzion
subfuzion / curl.md
Last active July 10, 2025 20:03
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@aazwar
aazwar / xcode_ramdisk.sh
Last active November 26, 2020 19:45
Speed up XCode 7
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
# PREREQUISITE:
# mkdir /Users/$USERNAME/Library/Developer/Xcode/DerivedData.shadow
## Unless you clear DerivedData folder, you can't mount ramdisk on it
# rm -r /Users/$USERNAME/Library/Developer/Xcode/DerivedData/*
@chockenberry
chockenberry / finder_icons.sh
Last active February 10, 2024 19:05
A simple shell script to turn the Finders desktop icons on and off
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
defaults write com.apple.finder CreateDesktop false
osascript -e 'tell application "Finder" to quit'
open -a Finder

🌁📉🌁🌁⬜⬜⬜🌁⬜🌁📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📃🏭📃🌁📃📃🌁📃📃🏂🏂🎂📃🌁🌁🏭📃🏢🏭🎂📃🏭📃🏢📃⛲⛲🕕⬜📩🔳🍧💈📤🎲📤📉🌁🌁📃🌁⬜📈⬜⬜⬜⬜🌁⬜⬜⬜⬜⬜🌁
⬜🌁🌁⬜⬜⬜🌁🌁🌁📃📃⬜⬜⬜⬜⬜⬜🌁⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁📃📃🌁📃💬🏢💬🌁🌁🌁🌁📃🏭💬💬🏭📃🌁🏭💬🏂⛲⛲📂⬜🌄🌄⚾📱💈📱🕖🏭📈📃🌁⬜⬜📈⬜⬜⬜🌁📝📝⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜🌁🌁🌁📃🌁🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁📃📃🌁📃🌁📃💬📂🏢🌁📃🏢📃📃💬🏭💬🏢🏢🏢🏢🏂⛲📖⛲🔣📉💬💌🌄📤💈👟🎲🎂🌁🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜🌁🌁📃📃📃📃📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🏭📃📃🌁📃💬🎂🔳📂🏂📃📉📉🌁⬜⬜🗼🗼🗼🗼📈📃📃📃📃🌁🎂🕓⚾📱💈💈🍜📈⬜🌁📃⬜🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜🌁📃📃📃📃🏭📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁🌁📃🏂🏢📃🕕🍚🌁⬜🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🎂🔳📧👀🔩🍧🐹🌁🌁🌁⬜⬜📈🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜🌁💬🏂📃📃🌁📃📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁📃🏭🏭🍚🏂🏢🏂🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📝🕕🎲🔏🔘🐚📩🌁⬜⬜🌁🌁🌁🗼🌁🌁🌁⬜⬜⬜🌁🌁🌁🌁⬜
⬜⬜⬜📜🌁📃🏂🏢📃🏢🏢🏢🏭🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁🌁📈📑🎡🏢🏢📃🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📃📠😰💌🎹📤⛅🎂⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📃📃
⬜⬜⬜🌁🏭🏭📃🏢🏢🏢🏢🏢📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁⬜⬜🌁🎡⬜🌁🏢🏢🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁💬📜💑🌄📤🏦🔤🏭⬜⬜⬜⬜⬜⬜🌁🌁📈🌁🌁📃🌁🌁🌁🏭💬
⬜🏭📃📃📃📃📃📂🏂🌁💬🏢📃⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🌁🌁⬜⬜🌁🏭🌁🗼💬🔳📃📃📉🗼🌁🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜🌁🎂📝📜🐹🔘👀🎹💬📝🌁📈🌁🌁🌁📈📃📃📈📃📈📃📃🏭🏭🏂
🌁🌁📃📃📃📃🏢🏂📃📃🌁📃📃🌁⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜📈📃🏂📈💬📃📉🏭📈📃🏭📈📈⬜⬜🌁📃⬜⬜⬜⬜⬜⬜📈🎂🏂📄🎂💌🔘🐚😱🎂📃📈📈🏭📈📈📈📃📈📈📈📈📃🏭📃📃💬