Skip to content

Instantly share code, notes, and snippets.

Avatar

Haris Amin hamin

View GitHub Profile
View 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 ASACyIRY0fUPf2dfVGQ2rfvMEfEfcdGG0axDgVdSXV77qQo

To claim this, I am signing this object:

View 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 Jul 8, 2016
ByteBuffer helper class
View ByteBuffer.swift
//
// ByteBuffer.swift
// mpush-client
//
// Created by OHUN on 16/6/3.
// Copyright © 2016年 OHUN. All rights reserved.
//
import Foundation
View 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 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 Aug 29, 2015
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/
View example.rb
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
View custom_camera_cropping_overlay.swift
// 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 Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Oct 26, 2019
Arcade Fire's 'The Suburbs' in Sonic PI ;) Download http://sonic-pi.net and copy paste this Grammy Winning gem ;)
View the_suburbs.rb
in_thread do
loop do
sample :drum_bass_hard, amp: 2
sleep 2
end
end
in_thread do
loop do
sleep 1
View simple_memcache.go
package main
import (
"bufio"
"flag"
"fmt"
"io"
"net"
"net/textproto"
"os"
@hamin
hamin / VerticalPeekingPagingLayout.h
Last active Aug 29, 2015
Vertical Scrolling UICollectionViewLayout Subclass with paging and peeking for next page enabled based on https://github.com/betzerra/EBCardCollectionViewLayout
View VerticalPeekingPagingLayout.h
#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