Skip to content

Instantly share code, notes, and snippets.

Pod::Spec.new do |s|
s.name = 'SYCache'
s.version = '1.0'
s.license = 'MIT'
s.summary = 'Fancy caching with on-disk persistence'
s.homepage = 'https://github.com/Synthetic/SYCache'
s.author = { 'Sam Soffes' => '[email protected]' }
s.source = { :git => 'https://github.com/Synthetic/SYCache.git', :commit => 'origin/master' }
s.source_files = 'SYCache.{h,m}'
s.description = 'Simple in memory and on disk cache. It\'s backed by an NSCache in memory, ' \

ENV encryption for Jenkins

You really want the variation with the public-private-keypair. The password variation should only be used for testing.

Without keys, with Password

This is more or less just for testing purposes. For production quality we want asymetric encryption, since then every third party can encrypt their secret stuff (passwords for example) with the build server's public key, so that the build server is able to decrypt it.

Encryption

  • echo 'MySecret' | openssl enc -base64 -e -aes-256-cbc -pass pass:mySecretPass

The concrete encryption results differ from every run - this is by purpose - don't get confused!

Creating a bootable OS X Mavericks USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the Mavericks installer sitting in /Applications/Install\ OS\ X\ Mavericks.app, run the following command in your terminal to create a bootable install media:

sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
@jk
jk / java_osx109.txt
Created October 13, 2013 10:41
Adresses to download Java SE 6 on OS X 10.9
http://swcdn.apple.com/content/downloads/08/20/091-7277/0ylo2rewk57p7unvqploy0j20guvy7d2er/JavaForOSX.pkg
http://swcdn.apple.com/content/downloads/08/20/091-7277/0ylo2rewk57p7unvqploy0j20guvy7d2er/JavaEssentials.pkg
http://swcdn.apple.com/content/downloads/08/20/091-7277/0ylo2rewk57p7unvqploy0j20guvy7d2er/JavaMDNS.pkg
http://swcdn.apple.com/content/downloads/08/20/091-7277/0ylo2rewk57p7unvqploy0j20guvy7d2er/JavaSecurity.pkg
@jk
jk / hardware.m
Last active December 25, 2015 06:19
#include <sys/types.h>
#include <sys/sysctl.h>
- (NSString*)hardwareDescription
{
NSString *hardware = [self hardwareString];
if ([hardware isEqualToString:@"iPhone1,1"]) return @"iPhone 2G";
if ([hardware isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([hardware isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
if ([hardware isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
UIDevice *device = [UIDevice currentDevice];
SEL selector = NSSelectorFromString([device.systemVersion hasPrefix:@"7"] ? @"_deviceInfoForKey:" : @"deviceInfoForKey:");
NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);
@jk
jk / weak.m
Last active December 23, 2015 23:49 — forked from krzysztofzablocki/gist:6711189
- (void)main {
__weak id obj;
// Wrong:
dispatch_async(queue, ^() {
[obj doSomething];
[obj doSomethingElse]; // can turn to nil at any point, should store in strong at beggining of block
[obj doSomethingElse2];
});
@jk
jk / check_countly.php
Last active December 23, 2015 12:19
A script to check if a count.ly instance is still running. Was written for a monit task/job.
#!/bin/php
<?php
// Active assert and make it quiet
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);
// Create a handler function
function my_assert_handler($file, $line, $code)
{
@jk
jk / FeatureContext.php
Last active February 14, 2019 16:37 — forked from michalochman/gist:3175175
Take screenshots with Behat + Mink + Selenium2 Stack when a step fails. CAUTION: Work in progress
<?php
use Behat\Behat\Event\StepEvent;
use Behat\Gherkin\Node\StepNode,
Behat\Gherkin\Node\ScenarioNode,
Behat\Gherkin\Node\FeatureNode;
use Behat\Mink\Driver\Selenium2Driver;
/**
@jk
jk / README.md
Last active April 27, 2018 18:02
Behat + Mink + Selenium 2 Stack

Important files

Here you find the DSL language definition for your phrases you can use in .feature files:

  • features/bootstrap/FeatureContext.php inherits from
  • vendor/behat/mink-extension/Behat/MinkExtension/Context/MinkContext.php

Installation

With Homebrew that gets really easy: