Skip to content

Instantly share code, notes, and snippets.

View StevenMasini's full-sized avatar
Climbing trees and eating bananas 🍌

Steven Masini StevenMasini

Climbing trees and eating bananas 🍌
View GitHub Profile
nilshoenson / Shader.metal
Last active June 28, 2024 20:51
A wave animation built with shaders in SwiftUI.
#include <metal_stdlib>
#include <SwiftUI/SwiftUI_Metal.h>
using namespace metal;
// Create a horizontal bar
float bar(vector_float2 uv, float start, float height) {
return step(uv.y, height + start) - step(uv.y, start);
// Create waves animation using GLSL
cprovatas / Data+PrettyPrint.swift
Created May 23, 2018 15:52
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
chourobin /
Last active June 28, 2024 20:49
React Native Bridging Cheatsheet
thousandlemons /
Last active November 20, 2021 00:14
How to setup Shadowsocks on your Ubuntu server
pronebird / CoreDataDuplicateRecordsPlayground.swift
Created July 11, 2016 18:26
Fetch duplicate records with CoreData
// Playground is where kids play
import CoreData
class City: NSManagedObject {
@NSManaged var name: String
var cityEntity = NSEntityDescription()
PurpleBooth /
Last active July 18, 2024 23:22
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


jabney / setOps.js
Last active February 1, 2023 10:55
Fast JavaScript set operations: union, intersection, difference, complement, and equals. Includes support for objects.
// setOps.js MIT License © 2014 James Abney
// Set operations union, intersection, symmetric difference,
// relative complement, equals. Set operations are fast.
(function(so) {
'use strict';
var uidList = [], uid;
// Create and push the uid identity method.
xmzio / Macros.swift
Last active October 21, 2019 07:31
My aLog and dLog macros in Swift (to abbreviate NSLog)
// Macros.swift
// Created by Xavier Muñiz on 6/12/14.
import Foundation
// dLog and aLog macros to abbreviate NSLog.
// Use like this:
irazasyed /
Last active June 14, 2024 17:01
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

dergachev /
Last active July 17, 2024 14:20
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


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