Skip to content

Instantly share code, notes, and snippets.

View elfenlaid's full-sized avatar
🐧
Slow Distillation ⚗️💭

Egor Mihnevich elfenlaid

🐧
Slow Distillation ⚗️💭
View GitHub Profile
@elfenlaid
elfenlaid / translate.clj
Created March 24, 2014 13:47
first useful script on clojure :)
(ns translate.core
(:use clojure-csv.core))
(defonce store (parse-csv (slurp "resources/trans.csv")))
(def lang-shortcuts { "Russian" "ru"
"French" "fr"
"Italian" "it"
"German" "de"
"Spanish" "es"
@elfenlaid
elfenlaid / OperationExample.m
Created May 15, 2014 11:32
Operation example
@interface MyAsyncOperation ()
@property (nonatomic) BOOL isExecuting;
@property (nonatomic) BOOL isFinished;
@end
@implementation MyAsyncOperation
- (void)start {
self.isFinished = NO;
self.isExecuting = YES;
@elfenlaid
elfenlaid / Fuckup.m
Created May 30, 2014 15:42
Simple copypaste became the reason of interesting debug story :)
+ (UIImage *)generatedBackground {
static NSArray *colors = nil;
if (!colors) {
colors = @[
[UIColor colorWithRed:0.957 green:0.138 blue:0.287 alpha:1.000],
...
[UIColor colorWithRed:0.972 green:0.207 blue:0.225 alpha:1.000],
];
}
@elfenlaid
elfenlaid / client.hs
Last active August 29, 2015 14:17 — forked from mpickering/client.hs
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Main
( main
) where
--------------------------------------------------------------------------------
import Control.Concurrent (forkIO)
import Control.Applicative ((<$>))
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@elfenlaid
elfenlaid / ipa_dir_observer.py
Last active December 14, 2015 00:29
Observe given directory and tag added IPA files
import sys
import time
from subprocess import Popen
from watchdog.observers import Observer
from watchdog.events import RegexMatchingEventHandler
class IpaDirectoryEventHandler(RegexMatchingEventHandler):
def on_modified(self, event):
first public gist
AVMutableAudioMix *exportAudioMix = [AVMutableAudioMix audioMix];
exportAudioMix.inputParameters = parameters;
AVAssetExportSession *export =
[[AVAssetExportSession alloc] initWithAsset:mixComposition
presetName:AVAssetExportPresetAppleM4A];
export.outputFileType = @"com.apple.m4a-audio";
export.outputURL = outputFileUrl;
export.audioMix = exportAudioMix;
OSStatus
MyAudioCallback(AudioConverterRef inAudioConverter,
UInt32 *ioDataPacketCount,
AudioBufferList *ioData,
AudioStreamPacketDescription **outDataPacketDescription,
void *inUserData);
CMTimeRange fadeInRange = CMTimeRangeMake(CMTimeMake(0, 1), CMTimeMake(self.fadeInToSec, 1));
[fadeInParameter setVolumeRampFromStartVolume:0.0 toEndVolume:1.0
timeRange:fadeInRange];
[parameters addObject:fadeInParameter];