Skip to content

Instantly share code, notes, and snippets.

View alessandrostone's full-sized avatar

Alessandro Aresta alessandrostone

View GitHub Profile
@alessandrostone
alessandrostone / generate-waves.zsh
Last active January 6, 2019 21:38
Generates small square waveform png's for every wav file using audiowaveform
#!/usr/bin/env zsh
# _
# ___ ___ ._ _ ___ _ _ ___ _| |_ ___ ___ _ _ _ ___ _ _ ___ ___
# / . |/ ._>| ' |/ ._>| '_><_> | | | / ._>|___|| | | |<_> || | |/ ._><_-<
# \_. |\___.|_|_|\___.|_| <___| |_| \___. |__/_/ <___||__/ \___./__/
# <___'
# Made with love by Alessandro Aresta on Sun Jan 06 2019
@alessandrostone
alessandrostone / gen-flac-visuals
Created January 6, 2019 20:32 — forked from pR0Ps/gen-flac-visuals
Generates spectrogram and waveform images from flac files
#!/bin/sh
# Requires: audiowaveform (https://github.com/bbc/audiowaveform), metaflac, sox
zoom_start=60
zoom_duration=4
zoom_end=$((zoom_start + zoom_duration))
if [ $# -lt 1 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo "Generates spectrogram and waveform images from flac files"
@alessandrostone
alessandrostone / file_sharing.swift
Created May 2, 2018 16:12 — forked from artemnovichkov/file_sharing.swift
Explore Documents folder in Files.app. Inspired by Ole's tweet https://twitter.com/olebegemann/status/987346188591681536
#!/usr/bin/env xcrun --sdk macosx swift
import Foundation
enum Configuration: String {
case debug = "Debug"
case release = "Release"
}
// Get Info.plist path
@alessandrostone
alessandrostone / colorLiteral.snippet
Created March 18, 2017 02:03
Xcode_Color_Literal_Snippet
#colorLiteral(red: 0.4593629837, green: 0.909394145, blue: 0.9056461453, alpha: 1)
@alessandrostone
alessandrostone / Xcode Increment Build Run Phase Script
Created November 12, 2016 17:10
Xcode Increment Build Run Phase Script
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@alessandrostone
alessandrostone / gist:cf8c31869db2a7ec9f8b4ac2ce8ce1a9
Created September 9, 2016 09:51
Fix Brew always get Already up-to-date.
If Homebrew was updated on Aug 10-11th 2016 and brew update always says Already up-to-date. you need to run:
cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update
@alessandrostone
alessandrostone / python
Last active November 12, 2016 17:12
easiest server ever
┌─────────────────────────────────────────────────────────────────────────────┐
│ __ │
│.-----.---.-.-----.--.--.-----.-----| |_ .-----.-----.----.--.--.-----.----.│
│| -__| _ |__ --| | | -__|__ --| _||__ --| -__| _| | | -__| _|│
│|_____|___._|_____|___ |_____|_____|____||_____|_____|__| \___/|_____|__| │
│ |_____| │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
# python -m SimpleHTTPServer 8000 python 2.*
#!/bin/sh
echo " ██████ ██████ ███████ ██ ██ ██ ██ ███████ ██████ ███████""
echo " ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██""
echo " ██████ ██████ █████ ██ █ ██ █████ █████ ██ ███ ███████""
echo " ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██""
echo " ██████ ██ ██ ███████ ███ ███ ██ ██ ███████ ██████ ███████""
echo ""
echo ""
echo " ███ ███ ███████ ██████ █████ ███████ ██ ██ ██""
@alessandrostone
alessandrostone / hack.sh
Created May 28, 2016 12:19 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@alessandrostone
alessandrostone / finder_icons.sh
Created May 21, 2016 16:53 — forked from chockenberry/finder_icons.sh
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