Skip to content

Instantly share code, notes, and snippets.

View jcayzac's full-sized avatar

Julien Cayzac jcayzac

View GitHub Profile
@jcayzac
jcayzac / cordova-meet-cocoapods.sh
Created March 13, 2014 06:12
hooks/before_build/cordova-meet-cocoapods
#!/usr/bin/env bash
# Cordova<>Cocoapods integration hook
#############################################################
# Make this file executable (chmod +x) and install it as a #
# "before_build" hook in your Cordova application (put it #
# in the <application_root>/hooks/before_build/ directory). #
# #
# The file <application_roo>/Podfile.in with be copied to #
# platforms/ios/Podfile when the iOS platform is built, #

#Fix the annoying OpenSSL 1.0.1 "Unknown Protocol" error with (lib)curl

  • Add a ciphers AES128-SHA,3DES line to ~/.curlrc.
  • Unfortunately, libcurl doesn't use .curlrc. So to get around the problem in git:
# some if the stuff here is macports-specific
$ port install autoconf automake
$ git clone https://github.com/git/git.git
$ cd git
@jcayzac
jcayzac / result.png
Last active August 29, 2015 13:57
Transparent JPEG
result.png
[vps ~]$ curl -D - 'http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=os'
HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Fri, 18 Apr 2014 01:35:01 GMT
Content-Type: text/plain
Connection: keep-alive
Content-Length: 0
[local ~] curl -D - 'http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=os'
HTTP/1.1 200 OK
# assuming SAR is 1:1,
SRC=Foo.mp4
SRC_WIDTH=1916
SRC_HEIGHT=852
DST_WIDTH=720
DST_HEIGHT=480
DST_ASPECT=16/9
DST_FPS=24000/1001
DST_RATE=4100k
@jcayzac
jcayzac / XXXLocation.m
Created October 16, 2014 05:41
iOS location updates listener example
@import Foundation;
@import CoreLocation;
////////////////////////////////////////////////////////////////////////////
@interface XXXLocation : NSObject<CLLocationManagerDelegate>
@property (nonatomic) BOOL trackingEnabled;
@property (nonatomic) BOOL updating;
@property (nonatomic, strong) CLLocationManager *locationManager;
@end
// Only called on iOS<8
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation __unused)toInterfaceOrientation duration:(NSTimeInterval __unused)duration {
[self _beforeOrientationChange];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation __unused)fromInterfaceOrientation {
[self _afterOrientationChange];
}
// Only called on iOS>8
@jcayzac
jcayzac / reset-sim.sh
Last active June 23, 2016 03:04
How to reset the iOS simulator properly
# source this in your Bash scripts
reset-sim() {
printf 'Close the frontend app if needed…'
killall iOS\ Simulator 2>&- && sleep 5 || true
printf ' Done.\n'
declare SIM_OS SIM SIM_ID
while read SIM
do
@jcayzac
jcayzac / MakeIPA
Created October 23, 2014 04:29
PackageApplication for Xcode6+
#!/usr/bin/env bash
set -e -u -o pipefail
export LANG="en_US.UTF-8"
cat <<EOT
Creating IPA with the following parameters:
Application path: "${1:-}"
Code signing identity: "${2:-}"
Provisioning profile path: "${3:-}"
@jcayzac
jcayzac / cibuild.sh
Last active August 29, 2015 14:08
CI build script for Xcode6.1/iOS8
#!/usr/bin/env bash -e -u -o pipefail
export LANG="en_US.UTF-8"
usage() {
cat <<EOT
NAME
${0##*/} -- Build iOS stuff.
SYNOPSIS