Skip to content

Instantly share code, notes, and snippets.

View oscahie's full-sized avatar

Oscar Hierro oscahie

View GitHub Profile
@oscahie
oscahie / gate.io-BTF.sh
Last active January 24, 2018 12:47
Monitors the gate.io exchange and notifies you (via push notification, which requires a valid Pushover account) when the deposits for Bitcoin Faith (BTF) are finally open, enabling some potentially great arbitrage possibilities :)
#!/bin/bash
COIN_NAME="Bitcoin Faith"
COIN_TICKER="BTF"
EXCHANGE="gate.io"
DEPOSIT_URL=("https://gate.io/myaccount/deposit/BTF" -H "Cookie: __cfduid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; captcha=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; market_title=BTC; captcha_reg=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; show_zero_funds=0; notice=Regarding"%"20the"%"20LLT"%"20and"%"20SNET"%"20Swap; total_fund=1; lasturl="%"2Fmyaccount"%"2Fdeposit"%"2FBTF; nav_index=2; uid=11111111; nickname=XXXXXXXX; pver=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Cache-Control: max-age=0")
DEPOSIT_DISABLED="<p>BTF deposit is disabled"
function push {
curl -s -F "token=<TOKEN>" \
@oscahie
oscahie / gist:0730c938fa43749cbfff1806b47c7d37
Last active June 28, 2016 14:47
Uses object introspection to print the list of properties and ivars of the instance, together with their current values when possible (i.e. when they are KVC compliant)
- (NSString *)osc_introspectiveDescription
{
// Loop through our superclasses until we hit NSObject
NSMutableArray *propertyList = [NSMutableArray array];
NSMutableArray *ivarList = [NSMutableArray array];
Class subclass = [self class];
while (subclass != [NSObject class])
{
unsigned int propertyCount;
@oscahie
oscahie / gist:5ee213b7f0bd0dbe301affc254450d93
Created June 28, 2016 14:21
track object deallocations on Apple frameworks
#import <objc/runtime.h>
@implementation AVPlayerItem(oscahie)
+ (void)load
{
Method origMethod = class_getInstanceMethod([self class], NSSelectorFromString(@"dealloc"));
Method patchMethod = class_getInstanceMethod([self class], @selector(swizzledDealloc));
method_exchangeImplementations(origMethod, patchMethod);
@oscahie
oscahie / apple_store_check.sh
Last active August 29, 2015 14:06
A super quick & dirty shell script to monitor the status of the Apple Online Store for any country
#!/bin/bash
# A super quick & dirty shell script to monitor the status of the Apple Online Store for any country.
# It does so by checking the HTTP status code returned upon requesting the main page (503 when it's down).
# When the store comes back online you get alerted through the speaker, in case you were sleeping :)
# You could probably easily change that to send an email or whatever instead.
APPLE_STORE_URL=http://store.apple.com/nl/buy-iphone/iphone6
STATUS=503