Skip to content

Instantly share code, notes, and snippets.

View sayan1886's full-sized avatar

Sayan Chatterjee sayan1886

  • IBM
  • India
  • 00:55 (UTC +05:30)
  • LinkedIn in/mesayan
View GitHub Profile
@lawliet89
lawliet89 / issues.md
Created January 22, 2018 09:07
Parity POA Issues

Issues with Assembly in Contract

Validator Contract

pragma solidity ^0.4.15;

contract ValidatorSet {
	/// Issue this log event to signal a desired change in validator set.
	/// This will not lead to a change in active validator set until
@michaelochs
michaelochs / IrisSegue.mm
Last active May 16, 2018 19:42
This is a segue that does an iris animation like the iOS camera app. Note: The name cameraIris is private API and might lead to rejection!
@implementation IrisSegue
- (void)perform
{
[self.sourceViewController presentViewController:self.destinationViewController animated:NO completion:^{
// don't ask - it just works with two calls to dispatch_async
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
NSString* shutterAnimationName = @"cameraIris";
@nuthatch
nuthatch / NSManagedObject+Serialization.h
Last active May 8, 2019 11:25 — forked from pkclsoft/NSManagedObject+Serialization.h
Fixes for Peter Easdown's category 1. don't assume each Entity name matches the Class name. 2. strip DATE_ATTR_PREFIX when deserializing dates back into NSManagedObject 3. add support for NSOrderedSet 4. use set to keep traversal history, and allow classes to opt-out with serializationObjectsToSkip
@interface NSManagedObject (Serialization)
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;
@end
@kristopherjohnson
kristopherjohnson / UIColor+KDJPackedRGB.h
Last active December 17, 2015 11:59
UIColor category to allow specification of color like [UIColor colorWithRGB24:0xfcfc22];
// Copyright (C) 2013 Kristopher Johnson
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@mayoff
mayoff / Arrow.swift
Last active May 13, 2022 07:30
UIBezierPath category to create an arrow (now with a Swift version!)
// Swift 2.2 syntax / API
import UIKit
extension UIBezierPath {
class func arrow(from start: CGPoint, to end: CGPoint, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat) -> Self {
let length = hypot(end.x - start.x, end.y - start.y)
let tailLength = length - headLength
@cblunt
cblunt / AppActivity.java
Created May 9, 2012 10:15
Android: Custom Styled Dialog without border or title
public void showCustomDialog() {
Dialog dialog = new Dialog(this, R.style.Theme.CustomDialog);
dialog.setContentView(R.layout.custom_dialog);
// ...
dialog.show();
}
@wannabegeek
wannabegeek / TFLog.h
Created April 7, 2012 10:20
Controlling Debug Logging Levels and Logging to File in Cocoa
//
// TFLog.h
//
// Created by Tom Fewster on 08/06/2010.
//
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
# import <UIKit/UIKit.h>
#else
# import <Cocoa/Cocoa.h>
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@pamelafox
pamelafox / withings.py
Created December 8, 2011 18:59
Withings Python OAuth Wrapper
# -*- coding: utf-8 -*-
# Based on https://github.com/ikasamah/withings-garmin/blob/master/withings.py
import urllib
from datetime import datetime
import urlparse
import oauth2 as oauth
try:
import json