Skip to content

Instantly share code, notes, and snippets.

View rolife's full-sized avatar

Nikolai Roller rolife

View GitHub Profile
@dulacp
dulacp / Overlay_iOS_app_version_on_icon_README.md
Last active November 19, 2017 11:18
Overlay the iOS application version on top of the icon

Usage

Requirements

Install the two dependencies, ImageMagick and Ghostscript.

$ brew install imagemagick
$ brew install ghostscript
@maciekish
maciekish / UINavigationBar+CustomHeight.h
Created September 10, 2014 08:48
Custom UINavigationBar height working in iOS 7 and 8. To use, find your navigation bar reference and just setHeight:200 etc.
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// 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
@shadcn
shadcn / gist:de147c42d7b3063ef7bc
Last active September 17, 2022 11:50
Convert a Hex string to UIColor in Swift
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
@olexth
olexth / Objective-C declension in russian language
Last active August 29, 2015 13:55
Declension for words in russian language depending on count between current word. More about declension: http://en.wikipedia.org/wiki/Russian_grammar#Declension_of_numerals
- (NSString *)stringFromCount:(NSUInteger)count
{
NSString *days = nil;
NSUInteger modulo10 = count % 10;
if (modulo10 == 1)
{
days = NSLocalizedString(@"день", nil);
}
if (modulo10 == 2 || modulo10 == 3 || modulo10 == 4)
{
@yangsu
yangsu / chrome-dev-tools-shortcuts.textile
Created November 10, 2013 22:41
Chrome Developer Tools - Useful Shortcuts (Mac OS X)

Chrome Developer Tools – Useful Shortcuts (Mac OS X)

General

⌥⌘I Toggle Developer Tools
⌥⌘C Toggle JavaScript Console
⌥⌘U Show Source

All Panels

@redent
redent / TCHorizontalSelectorView
Created September 6, 2013 09:12
Horizontal selector view with view reuse and infinite circular scrolling, allowing more than one element per page
//
// TCHorizontalSelectorView.m
// TwinCodersLibrary
//
// Created by Guillermo Gutiérrez on 16/01/13.
// Copyright (c) 2013 TwinCoders S.L. All rights reserved.
//
#import <UIKit/UIKit.h>
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 20, 2025 23:00
A badass list of frontend development resources I collected over time.
@evadne
evadne / gist:5596987
Created May 17, 2013 04:49
Correctly Handling ACErrorAccountNotFound
ACAccountStore * const accountStore = [ACAccountStore new];
ACAccountType * const accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[accountStore requestAccessToAccountsWithType:accountType options:@{
ACFacebookAppIdKey: @"-snip-"
} completion:^(BOOL granted, NSError *error) {
if (!granted) {
switch (error.code) {
case ACErrorAccountNotFound: {
dispatch_async(dispatch_get_main_queue(), ^{
@jdkanani
jdkanani / notepad.html
Last active June 16, 2024 13:44 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`