Skip to content

Instantly share code, notes, and snippets.

View karpelcevs's full-sized avatar

Romans Karpelcevs karpelcevs

  • Tallinn, Estonia
  • X @cvbk
View GitHub Profile
@Jaybles
Jaybles / UIDeviceHardware.h
Created October 28, 2011 19:33
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@carlj
carlj / gist:3782351
Created September 25, 2012 14:44
iPhone 5 UIImage Category
+ (UIImage*)imageNamedForDevice:(NSString*)name {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
if (([UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale) >= 1136.0f)
{
//Check if is there a path extension or not
if (name.pathExtension.length) {
name = [name stringByReplacingOccurrencesOfString: [NSString stringWithFormat:@".%@", name.pathExtension]
withString: [NSString stringWithFormat:@"-568h@2x.%@", name.pathExtension ] ];
@mikezs
mikezs / UIDeviceHardware.h
Created December 17, 2012 13:09 — forked from Jaybles/UIDeviceHardware.h
Find the Apple model identifier and give a string representation of it
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
+ (NSString *) platform;
@artemstepanenko
artemstepanenko / NSOperationQueue+Completion.h
Created November 23, 2013 21:57
This NSOperationQueue's category solves very simple task. Now you can add completion callback to NSOperationQueue instance.
//
// NSOperationQueue+Completion.h
// QueueTest
//
// Created by Artem Stepanenko on 23.11.13.
// Copyright (c) 2013 Artem Stepanenko. All rights reserved.
//
typedef void (^NSOperationQueueCompletion) (void);
@vestel
vestel / tag.py
Last active August 29, 2015 13:57
tag.py
#!/sevabot
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import re
import Skype4Py
from sevabot.bot.stateful import StatefulSkypeHandler
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@derjohng
derjohng / xcode_ramdisk.sh
Last active June 6, 2022 03:36 — forked from skeeet/xcode_ramdisk.sh
Create a RAM disk for using with XCode, with Umount disks method
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
@valeriomazzeo
valeriomazzeo / xcode-icon-tag.sh
Last active January 27, 2022 10:19
Xcode Icon Version Overlay
# xcode-icon-tag.sh
# The MIT License (MIT)
#
# Copyright (c) <2015> <Valerio Mazzeo>
# 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
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@davidrleonard
davidrleonard / add-team-to-repos.js
Last active May 8, 2024 15:11
Add a new team to all Github repos in an organization
/*
* Adds a team to all the repos in a Github organization. This is a tedious
* process in the UI. You'll need a newer version of node to run this (e.g 9+)
* because it uses async/await.
*
* Instructions:
*
* 1. Copy this file somewhere on your computer, e.g. ~/addteamrepos.js
* 2. Fill in the uppercase variables below with the right values
* 3. Run this file: `$ node ~/addteamrepos.js`