This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - iTunes Store API | |
#define ITUNES_APP_ID @"870393074" | |
- (void)updateReviewCount | |
{ | |
NSString *countryCode = [[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode] lowercaseString]; | |
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/%@/lookup?id=%@", countryCode, ITUNES_APP_ID]; | |
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 初期設定 | |
WORK=$HOME/Builds/GCC | |
PREFIX=$HOME/mingw | |
export PATH="$HOME/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" | |
# ソースコードのダウンロード | |
if [ ! -d $WORK/src ] ; then | |
mkdir src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <time.h> | |
#import <os/lock.h> | |
#define ITERS 2000 | |
#define NSEC_PER_ITER(time) (((double)time * (double)NSEC_PER_SEC) / (double)ITERS) | |
#define TEST(body, name) do {\ | |
start = [NSDate date];\ | |
for (int i = 0; i < ITERS; i++) {\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MinimalDecoder : Decoder { | |
var codingPath = [CodingKey?]() | |
var userInfo = [CodingUserInfoKey : Any]() | |
public func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> { | |
return KeyedDecodingContainer(MinimalKeyedDecodingContainer<Key>(decoder: self)) | |
} | |
public func unkeyedContainer() throws -> UnkeyedDecodingContainer { | |
return DecodingContainer(decoder: self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreGraphics | |
protocol VectorType { | |
typealias Element | |
var xElement: Element { get } | |
var yElement: Element { get } | |
class func buildFrom(#x: Element, y: Element) -> Self | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -e | |
HOST=${1:-cloudflare.com} | |
FILENAME=${2:-${HOST%%.*}} | |
# For file naming, see https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them | |
# For HTTP Public Key Pinning (HPKP), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning | |
CERTIFICATE_PEM="${FILENAME}_certificate.ascii.crt" | |
CERTIFICATE_DER="${FILENAME}_certificate.crt" | |
PUBKEY_PEM="${FILENAME}_pubkey.ascii.key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nmap -sP 192.168.0.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$ | |
slack[name=%(__name__)s] | |
action = %(action_with_slack_notification)s | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: https://blog.lobraun.de/2015/06/06/mount-sd-cards-within-virtualbox-on-mac-os-x/ | |
Mount SD Cards within VirtualBox on Mac OS X | |
Sometimes you need to mount your SD cards inside a VirtualBox machine to work with the files on the card. Working with the Raspberry Pi SD card on Mac OS X is an example for this. | |
My Raspberry Pi runs on Linux with some version of the EXT file system. While there is some support for this on Mac OS X, the available solutions have a lot of limitations, especially when it comes to write support on EXT file systems. As I do not have an USB keyboard, I sometimes need to mount the filesystem on another system to fix a startup problem when some of my experiments go wrong. | |
VirtualBox in theory allows for passing the internal card reader of the MacBooks to the virtual machine. Unfortunately, this does not work for me (and it seems for many other people). |
OlderNewer