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
/* DeviceUID.h | |
#import <Foundation/Foundation.h> | |
@interface DeviceUID : NSObject | |
+ (NSString *)uid; | |
@end | |
*/ | |
// Device.m |
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> | |
#include <dlfcn.h> | |
NSDictionary *FCPrivateBatteryStatus() | |
{ | |
static mach_port_t *s_kIOMasterPortDefault; | |
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options); | |
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT); | |
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name); |
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 python | |
# encoding: utf-8 | |
""" | |
Profile system performance | |
Created by Niall Kavanagh <[email protected]> on 2/5/2015 | |
""" | |
from __future__ import print_function | |
import argparse | |
import time |
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
function method fibn(n: int, f1: int, f2: int): int | |
requires n >= 0; | |
decreases n; | |
{ | |
if n > 1 then fibn(n-1, f2, f1+f2) else f2 | |
} | |
function method fib(n: int): int | |
requires n >= 0; | |
decreases n; |
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
@danielpunkass I think you underestimate how big cities are. |
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/bash | |
# | |
# ************************************************* | |
# chkconfig: 2345 99 99 | |
# description: notify email address on system boot. | |
# ************************************************* | |
# Installing: | |
# 1) save as /etc/rc.d/init.d/notify | |
# 2) set the desired email address in "MAILADD" variable | |
# 3) chmod a+w /etc/rc.d/init.d/notify |
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/bash | |
# Copyright bitly, Aug 2011 | |
# written by Jehiah Czebotar | |
DATAFILE="/var/tmp/nagios_check_forkrate.dat" | |
VALID_INTERVAL=600 | |
OK=0 | |
WARNING=1 | |
CRITICAL=2 |
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/bash | |
tmp="/var/tmp" | |
scripts=$(dirname $0) | |
scripts=$(cd "$scripts" && pwd) | |
datetime=$(date "+%F %T") | |
output_dir="$scripts" | |
lockfile="$output_dir/sample.lock" |
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
#define RGB(r, g, b) | |
[UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] | |
#define RGBA(r, g, b, a) | |
[UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] |
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
@implementation UITextView (RSExtras) | |
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
/*[s length] is assumed to be 0 or 1. s may be nil. | |
Totally not a strict check.*/ | |
if (s == nil || [s length] < 1) | |
return NO; |
NewerOlder