Skip to content

Instantly share code, notes, and snippets.

View cagatayk's full-sized avatar

Cagatay cagatayk

View GitHub Profile
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@vgoltv
vgoltv / FWKCIImageView.h
Created August 19, 2016 17:51
display CIImage via GLKView
//
// FWKCIImageView.h
// LineEngraver
//
// Created by Viktor Goltvyanytsya on 8/8/16.
//
//
@JeOam
JeOam / Animation.md
Last active July 11, 2024 03:30
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

Author: https://www.cyanhall.com/

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

@DarkKor
DarkKor / MusicGrabber.m
Last active October 17, 2017 09:30
The code for MusicGrabber, which can save music from iPod-library to your Documents or Caches.
+ (void)saveMusicFromURL: (NSURL *)sourceURL
toFile: (NSURL *)destURL
completion: (void(^)(BOOL success))_completion
{
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:sourceURL options:nil];
NSError *err = nil;
AVAssetReader *reader = [[AVAssetReader assetReaderWithAsset: asset
error: &err] retain];
if(err)
@omz
omz / iTC Downloader.py
Created July 29, 2013 23:35
iTC Downloader
# -*- coding: utf-8 -*-
# iTC Sales Report Downloader
# When you run this for the first time, you'll need to enter your
# iTunes Connect login and vendor ID. You can find the vendor ID
# on the iTunes Connect website by navigating to "Sales and Trends";
# it's the number next to your name (top-left).
CURRENCY = 'EUR'
RESET_LOGIN = False # Set to True to remove login from keychain