Skip to content

Instantly share code, notes, and snippets.

Reda Lemeden kaishin

Block or report user

Report or block kaishin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kaishin / asset.m
Created Jul 1, 2013
Get statusBar window
View asset.m
UIWindow *statusBar = [[UIApplication sharedApplication] performSelector:@selector(statusBarWindow)];
kaishin / gray-with-lightness.scss
Created Oct 24, 2013
Return a gray color with a level of lightness.
View gray-with-lightness.scss
@function gray-with-lightness($level: 0.5) {
@if $level > 1 {
$level: 1.0;
} @else if $level < 0 {
$level: 0.0;
@return lighten(#000, percentage($level));
kaishin / threadCheck.m
Last active Dec 27, 2015
My concurrency homie. Sprinkle some of it inside and around your blocks and concurrency will never come back to haunt you again.
View threadCheck.m
NSLog([NSThread currentThread] == [NSThread mainThread] ? @"❇️ Main thread, it is." : @"♒️ Doesn't look like main thread around here...");
kaishin / UIColor+isLight.h
Last active Jun 16, 2016
Get whether a color is dark or light using either luminance or lightness.
View UIColor+isLight.h
#import <UIKit/UIKit.h>
@interface UIColor (isLight)
- (CGFloat)lightness;
- (CGFloat)perceivedLightness;
- (CGFloat)perceivedLightnessW3C;
- (BOOL)isLight;
- (BOOL)isPerceivedLightW3C;
- (BOOL)isPerceivedLight;
kaishin / NSColor+isLight.h
Last active Sep 25, 2019
Programmatically determine the perceived lightness of a color. More details on: + Online tool:
View NSColor+isLight.h
#import <Cocoa/Cocoa.h>
@interface NSColor (isLight)
- (BOOL)isLight;
kaishin /
Last active Aug 29, 2015
Accordion Tabs
ACTIVE_CLASS = 'js-is-active'
$tabs = $("[data-role='tab']")
$toggles = $tabs.find("[data-role='link']")
$toggles.on 'click', (event) ->
$toggle = $(@)
$tab = $toggle.closest($tabs)
unless $tab.hasClass(ACTIVE_CLASS)
kaishin / dataSize.m
Created Jun 1, 2014
Log NSData size in a human-readable format.
View dataSize.m
NSLog(@"%@",[NSByteCountFormatter stringFromByteCount:data.length countStyle:NSByteCountFormatterCountStyleFile]);
kaishin / SassMeister-input-HTML.html
Created Jun 2, 2014
Generated by
View SassMeister-input-HTML.html
<div class="container">
<section>Section 1</section>
<section>Section 2</section>
View selector-helpers.scss
@function attr-ends-with-string($attr, $string) {
@return "[#{$attr}$=#{$string}]";
kaishin / SassMeister-input.scss
Last active Aug 29, 2015
Generated by
View SassMeister-input.scss
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// Bourbon (v4.0.2)
// Neat (v1.6.0)
// ----
@import "bourbon/bourbon";
$grid-columns: 6;
@import "neat/neat";
You can’t perform that action at this time.