Skip to content

Instantly share code, notes, and snippets.

View norsez's full-sized avatar
💭
busy coding

Norsez Orankijanan norsez

💭
busy coding
View GitHub Profile
@interface Base58Encoder : NSObject {
}
+ (NSString *)base58EncodedValue:(long long)num;
+ (NSString *)base58DecodedValue:(NSString *)strNum;
@end
@jessedc
jessedc / iOS Icon.png bash script
Last active February 25, 2018 03:02
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
@jetsanix
jetsanix / reset_app_store.sh
Created July 26, 2012 00:19
Reset the App Store on Os X Mountain Lion
#!/bin/sh
rm ~/Library/Preferences/com.apple.appstore.plist
rm -r ~/Library/Saved\ Application\ State/com.apple.appstore.savedState
rm -r ~/Library/Caches/com.apple.appstore
rm -r /private/var/folders/*/*/*/com.apple.appstore
@demigod19892012
demigod19892012 / [IOS] How to capture UIView to UIImage.m
Created April 4, 2013 15:01
[IOS] How to capture UIView to UIImage
+ (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active July 6, 2024 13:12
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@timohausmann
timohausmann / facebook_graph_api.pde
Last active March 20, 2019 23:05
Simple Facebook Graph API Example With Processing
/**
* In this example, we will request your first name and your profile picture from Facebook.
* We will store the acquired information in these variables:
*/
String my_name;
PImage my_photo;
/**
* You need an Access Token to perform requests to the Facebook Graph API.
* Access Tokens are only valid for a short period of time (1-2 hours).
@mmick66
mmick66 / UICollectionViewFlowLayoutCenterItem.m
Last active August 2, 2022 10:06
UICollectionViewFlowLayout with arbitrary sized Paging
#import "UICollectionViewFlowLayoutCenterItem.h"
@implementation UICollectionViewFlowLayoutCenterItem
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f;
CGRect proposedRect = self.collectionView.bounds;
@turowicz
turowicz / swift-json-class.md
Last active February 21, 2017 07:00
Apple Swift strong type object serialization to JSON
@gillesdemey
gillesdemey / querystring.swift
Last active March 24, 2021 10:53
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
@cathandnya
cathandnya / BaseUnitValue.swift
Last active May 2, 2019 14:18
base36 or base58 decoder
import Foundation
extension String {
func baseUnitValue(letters: String) -> Int? {
let base = countElements(letters)
func getNum(s: String) -> Int? {
if let idx = letters.rangeOfString(s) {
return distance(letters.startIndex, idx.startIndex)
} else {