Skip to content

Instantly share code, notes, and snippets.

View mbaranowski's full-sized avatar

Matthew Baranowski mbaranowski

View GitHub Profile
{
"0.14.0-dev.2162+3054486d1": {
"version": "0.14.0-dev.2162+3054486d1",
"date": "2024-11-04",
"docs": "https://ziglang.org/documentation/master/",
"stdDocs": "https://ziglang.org/documentation/master/std/",
"src": {
"tarball": "https://ziglang.org/builds/zig-0.14.0-dev.2162+3054486d1.tar.xz",
"shasum": "10ed4c14e0cce44e0d32abe973315bf4f4eb2cd26e1076f6590210112e50b6ee",
"size": "17633548"
@mbaranowski
mbaranowski / sourcekitten_class_inheritance.jq
Created July 20, 2018 18:24
SourceKitten Class Inheritance JQ script
# run with
# jq -S -f sourcekitten_class_inheritance.jq sourcekitten_doc_output.json > output.json
def splitDotLast: split(".") | .[-1];
def isClassOrExtension(kind):
kind == "class" or kind == "extension" or kind == "protocol";
def isSelected:
isClassOrExtension(.["key.kind"] | splitDotLast)
@mbaranowski
mbaranowski / CylinderViewController.swift
Created January 3, 2018 18:11
Make a Cylinder using SceneKit in swift
//
// GameViewController.swift
// SceneKitTest
//
// Created by Matt Baranowski on 12/19/17.
// Copyright © 2017 Matt Baranowski. All rights reserved.
//
import SceneKit
import QuartzCore
#import "MinReact.h"
@implementation ActionStateInit
@end
@implementation Subscription
@end
@interface Store ()
@mbaranowski
mbaranowski / ReObjectiveC.h
Created August 24, 2016 12:33
ReObjectiveC.h
#import <Foundation/Foundation.h>
@protocol Action <NSObject>
@end
@interface ActionStateInit : NSObject <Action>
@end
@protocol StateType <NSObject>
@end
@mbaranowski
mbaranowski / NSObject + injected
Created February 13, 2015 17:02
Give every NSObject a typesafe dependency injection class method (injected)
//
// NSObject+injected.h
//
#import <Foundation/Foundation.h>
#import <JInjector.h>
@interface NSObject (injected) <JInjectable>
+(instancetype)injected;
@end
UIMotionEffectGroup* effectGroup = [[UIMotionEffectGroup alloc] init];
UIInterpolatingMotionEffect* horizontalParallax =
[[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center"
type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
UIInterpolatingMotionEffect* verticalParallax =
[[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center"
type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
int main(int argc, const char * argv[])
{
// c++98
int* array[2];
array[0] = new int[5];
array[1] = new int[2];
// c++11 only, 1d initializer
int array4[] = {1,2,3,4,5};
int* array3= new int[3]{1,2,3};
@mbaranowski
mbaranowski / gist:5245710
Created March 26, 2013 14:20
Slice The Images
package main
import (
"fmt"
"image"
"image/png"
"os"
"log"
"strconv"
)
@mbaranowski
mbaranowski / gist:4253529
Created December 10, 2012 21:21
openGL Axis
glBegin(GL_LINES);
glColor3f(1.0f,0.0f,0.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f);
glColor3f(0.0f,1.0f,0.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f);
glColor3f(0.0f,0.0f,1.0f); glVertex3f(0.0f, 0.0f, 0.0f); glVertex3f(0.0f, 0.0f, 1.0f);
glEnd( );