Skip to content

Instantly share code, notes, and snippets.

View arielelkin's full-sized avatar

Ariel Elkin arielelkin

View GitHub Profile
protocol StringType {
var isEmpty: Bool { get }
}
extension String : StringType { }
extension Optional where Wrapped: StringType {
var isNullOrEmpty: Bool {
return self?.isEmpty ?? true
}
@arielelkin
arielelkin / ffmpeg.md
Created December 8, 2018 17:51 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@arielelkin
arielelkin / horrible-storyboard.md
Created July 25, 2018 13:30 — forked from iraycd/horrible-storyboard.md
Bad Experiences with Storyboard.

Interestingly Apple doesn't even use Storyboards in their recently open-sourced ResearchKit as [Peter Steinberger has noticed][1] (under the subheading "Interface Builder").

As expected, Apple keeps improving Storyboards and Xcode. Some of the points that applied to iOS 7 and below don't apply to iOS 8 anymore (and are now marked as such). So while Storyboards inherently still have flaws, I revise my advice from don't use to selectively use where it makes sense.

Even now that iOS 7 is out, I would advise against to use caution when deciding whether to use Storyboards. Here are my reasons:

  • Storyboards fail at runtime, not at compile time: You have a typo in a segue name or connected it wrong in your storyboard? It will blow up at runtime. You use a custom UIViewController subclass that doesn't exist anymore in your storyboard? It will blow up at runtime. If you do such things in code, you will catch them early on, during compile time. Update: My new tool **[StoryboardLin
@arielelkin
arielelkin / snowden-ietf93.md
Created April 5, 2018 22:22 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@arielelkin
arielelkin / trolling_haskell
Created March 1, 2017 14:06 — forked from quchen/trolling_haskell
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@arielelkin
arielelkin / gist:0c974b2d81f9f4e5f4f5
Last active November 20, 2015 13:55
Compile nginx standalone without root access
# Compile nginx standalone without root access
mkdir ~/installed
mkdir ~/installed/nginx
mkdir ~/src
cd ~/src
wasup wasup
# Grab nginx
wget http://sysoev.ru/nginx/nginx-0.7.50.tar.gz