Skip to content

Instantly share code, notes, and snippets.

View vilanovi's full-sized avatar

Joan Martin vilanovi

View GitHub Profile
@vilanovi
vilanovi / pod-install
Created October 25, 2021 22:47
Runs pod install on the same version of the Podfile.lock, installing cocoapods version via gem if not installed.
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
if test -f "Podfile.lock";
then
VALUE=`cat Podfile.lock | grep COCOAPODS`
POD_VER=$(echo $VALUE | sed 's/COCOAPODS: //g')
@Deub27
Deub27 / UIStackView+removeAll.swift
Created November 25, 2017 14:00
Remove all arranged subviews from UIStackView at once
import UIKit
extension UIStackView {
func removeAllArrangedSubviews() {
let removedSubviews = arrangedSubviews.reduce([]) { (allSubviews, subview) -> [UIView] in
self.removeArrangedSubview(subview)
return allSubviews + [subview]
}
@oliver
oliver / dct-demo.py
Created April 14, 2014 20:28
create an animation showing Discrete Cosine Transform and what its frequency levels look like
#!/usr/bin/python
import sys, os
from PIL import Image
import numpy
import scipy.fftpack
sourceImage = sys.argv[1]
image = Image.open(sourceImage)