Skip to content

Instantly share code, notes, and snippets.

View hamin's full-sized avatar

Haris Amin hamin

  • Currently ionq.co. Previously symbiont.io, getpager.com, itsglimpse.com, dailburn.com
  • New York,NY
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hamin on github.
  • I am harisamin (https://keybase.io/harisamin) on keybase.
  • I have a public key ASACyIRY0fUPf2dfVGQ2rfvMEfEfcdGG0axDgVdSXV77qQo

To claim this, I am signing this object:

@hamin
hamin / Keybase.md
Created March 20, 2017 20:22
Keybase.md

Keybase proof

I hereby claim:

  • I am hamin on github.
  • I am harisamin (https://keybase.io/harisamin) on keybase.
  • I have a public key ASB9ZTWf0tZzLnIMn6zuuLjj8cZHNKBac988C_912BTPiAo

To claim this, I am signing this object:

@hamin
hamin / ByteBuffer.swift
Created July 8, 2016 19:17
ByteBuffer helper class
//
// ByteBuffer.swift
// mpush-client
//
// Created by OHUN on 16/6/3.
// Copyright © 2016年 OHUN. All rights reserved.
//
import Foundation

Keybase proof

I hereby claim:

  • I am hamin on github.
  • I am harisamin (https://keybase.io/harisamin) on keybase.
  • I have a public key whose fingerprint is 4312 6149 4661 B058 D565 4799 AD33 7AA4 4052 82BD

To claim this, I am signing this object:

@hamin
hamin / example.rb
Last active August 29, 2015 14:26
An updated Rust 1.x version of Yehuda's Native Rust Extension post here http://blog.skylight.io/bending-the-curve-writing-safe-fast-native-gems-with-rust/
require "./points"
p1 = RustPoint::make_point(10, 10) # => #<Fiddle::Pointer:0x007f8231e56510 ptr=0x0000010b824000 size=0 free=0x00000000000000>
p2 = RustPoint::make_point(20, 20) # => #<Fiddle::Pointer:0x007f8231f20970 ptr=0x0000010b824010 size=0 free=0x00000000000000>
RustPoint::get_distance(p1, p2) # => 14.142135623730951
// Discussion on how to do custom cropping overlay on UIImageViewPicker
// https://gist.github.com/Raiden996/74ea67db8f17673f1b8b
func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) {
println("viewcontrollers count: \(navigationController.viewControllers.count)")
if navigationController.viewControllers.count == 3 {
println("viewcontrollers name: \(navigationController.viewControllers[2].classString())")
if (navigationController.viewControllers[2].classString() == "PUUIImageViewController") || (navigationController.viewControllers[2].classString() == "PLUIImageViewController") {
addOverlayToImagePicker(viewController)
@hamin
hamin / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hamin
hamin / the_suburbs.rb
Last active October 26, 2019 08:50
Arcade Fire's 'The Suburbs' in Sonic PI ;) Download http://sonic-pi.net and copy paste this Grammy Winning gem ;)
in_thread do
loop do
sample :drum_bass_hard, amp: 2
sleep 2
end
end
in_thread do
loop do
sleep 1
package main
import (
"bufio"
"flag"
"fmt"
"io"
"net"
"net/textproto"
"os"
@hamin
hamin / VerticalPeekingPagingLayout.h
Last active August 29, 2015 14:07
Vertical Scrolling UICollectionViewLayout Subclass with paging and peeking for next page enabled based on https://github.com/betzerra/EBCardCollectionViewLayout
#import <UIKit/UIKit.h>
@interface VerticalPeekingPagingLayout : UICollectionViewLayout
@property (readonly) NSInteger currentPage;
@property (assign, nonatomic) NSInteger startPage;
@property (nonatomic, assign) UIOffset offset;
@property (nonatomic, strong) NSDictionary *layoutInfo;
@end