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
""" | |
Automate loading of F-Script Anywhere into any app. | |
By Daniel Jalkut - @danielpunkass - http://indiestack.com/ | |
To set up: | |
0. Make sure you have FScript.framework installed in /Library/Frameworks (http://www.fscript.org) | |
1. Copy this script to ~/.lldb/fsa.py | |
2. Add the following to your ~/.lldbinit file: |
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
SimpleGeo::Client.set_credentials(ENV['SIMPLEGEO_KEY'],ENV['SIMPLEGEO_SECRET']) | |
resp = SimpleGeo::Client.geocode_from_ip() | |
options = {:num=>1} | |
place = SimpleGeo::Client.get_places(resp[:query][:latitude], resp[:query][:longitude], options) | |
phone = place[:features][0][:properties][:phone] | |
@area_code = phone[3..-10] # Phone number format: "+1 XXX XXX-XXXX" |