Skip to content

Instantly share code, notes, and snippets.

View svetlanama's full-sized avatar

Svitlana Moiseyenko svetlanama

View GitHub Profile
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active May 6, 2024 13:07
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@uupaa
uupaa / ios.xcode.md
Last active January 28, 2020 09:36
iOS device spec, versions and Xcode deployment target information

iOS Devices

Device CPU GPU Display OpenGL
iPod touch 4 A4 PowerVR SGX535 960 x 640 2.1
iPod touch 5 A5 PowerVR SGX543MP2 1136 x 640 2.1
iPad 1 A4 PowerVR SGX535 1024 x 768 2.1
iPad 2 A5 PowerVR SGX543MP2 1024 x 768 2.1
iPad 3 A5X PowerVR SGX543MP4 2048 x 1536 2.1
iPad 4 A6X PowerVR SGX554MP4 2048 x 1536 2.1
@nlothian
nlothian / Penn Treebank II Tags.md
Last active June 11, 2024 19:06
Penn Treebank II Tags
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing
@sebmarkbage
sebmarkbage / transferring-props.md
Last active August 2, 2022 10:44
Deprecating transferPropsTo

Deprecating transferPropsTo

It's a common pattern in React to wrap a component in an abstraction. The outer component exposes a simple property to do something that might have more complex implementation details.

We used to have a helper function called transferPropsTo. We no longer support this method. Instead you're expected to use a generic object helper to merge props.

render() {
 return Component(Object.assign({}, this.props, { more: 'values' }));
@ShamylZakariya
ShamylZakariya / debounce.swift
Created September 4, 2014 21:01
Simple Swift Debouncer
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() {
var lastFireTime:dispatch_time_t = 0
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC))
return {
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0)
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
@katoy
katoy / draw.swift
Last active October 28, 2016 09:48
draw line in playground (Xcode 6.1)
// See http://techlife.cookpad.com/entry/2014/11/12/170041
//
// 本来はplayground用に用意されているXCPlaygroundフレームワークのXCPShowViewを使って
// Timelineに表示することが可能ですが、現行のXcode6.1でiOS用にUIKitを使って表示した場合
// コンソールにエラーが出てしまうため使用していません。
//
import UIKit
// ビューのサイズ
func sumRecursively(numbers: [Int], _ acc:Int = 0) -> Int {
if let head = numbers.first {
let tail = Array(dropFirst(numbers))
return sumRecursively(tail, head + acc)
} else {
return acc
}
}
let myNumbers = [1,2,3,4,5]
@scottdelly
scottdelly / FacebookLogin.swift
Last active April 23, 2021 21:43
Facebook Login with iOS SDK 4.0 in Swift
//If you have a Bridging-Header:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
//In your AppDelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [String: AnyObject]?) -> Bool {
//App launch code
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
//Optionally add to ensure your credentials are valid:
@alexnodejs
alexnodejs / async-calls
Created May 14, 2015 00:00
Wait for multiple async calls and do something after that (Swift)
let url = NSURL(string: "https://www.google.net")
let request = NSURLRequest(URL: url!)
let group = dispatch_group_create()
for index in 1...100 {
dispatch_group_enter(group)
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) {(response, data, error) in
println("\(index) complete")
dispatch_group_leave(group)
}