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
def awakeFromNib | |
@menu = NSMenu.alloc.initWithTitle("Main Menu") | |
@status_bar = NSStatusBar.systemStatusBar | |
@status_item = @status_bar.statusItemWithLength(NSVariableStatusItemLength) | |
@status_item.setHighlightMode(true) | |
@status_item.setMenu(@menu) | |
@app_icon = NSImage.imageNamed('iplayer_logo_small_black.tiff') | |
@app_icon_alt = NSImage.imageNamed('iplayer_logo_small_white.tiff') |
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
// Check that you have a minimum amount of disk space free on an iPhoneOS device | |
- (BOOL)hasDiskSpaceAvailable { | |
NSUInteger minimumDiskSpace = 400 * 1024 * 1024; // 400MB limit | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
struct statfs tStats; | |
statfs([[paths lastObject] cString], &tStats); | |
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
a=year%19 | |
b=year/100 | |
c=year%100 | |
d=b/4 | |
e=b%4 | |
f=(b+8)/25 | |
g=(b-f+1)/3 | |
h=(19*a+b-d-g+15)%30 | |
i=c/4 | |
k=c%4 |
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
nick@ubuntu:/mnt/disk2/koan/angstrom/setup-scripts$ MACHINE=at91sam9g20ek ./oebb.sh bitbake console-image | |
Configured layers: | |
layer repository name: bitbake | |
layer uri: git://github.com/openembedded/bitbake.git | |
layer branch/revision: master/HEAD | |
Updating layer at layers/bitbake | |
Current branch 1.12 is up to date. | |
Layers present in repository: |
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
class FadeWindow < NSWindow | |
def fadeInAndMakeKeyAndOrderFront(orderFront) | |
self.setAlphaValue(0); | |
if orderFront | |
self.makeKeyAndOrderFront(nil) | |
end | |
self.animator.setAlphaValue(1.0) | |
end |
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
0x000000bb | |
00=0x00000000 | |
01=0x00000000 | |
02=0x00000320 | |
03=0x00000180 | |
04=0x000002ee | |
05=0x00000000 | |
06=0x00000000 | |
07=0x000000bb | |
08=0x00000000 |
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 parse_vagrant_vms { | |
# Use sed to strip out the whitespace, can't seem to get wc to give nice formatting standalone | |
# Thanks to @pkqk for showing me the speedy 'VBoxManage' command | |
local vm_count=$(VBoxManage list runningvms | wc -l | sed 's/^ *//; s/; */;/g') | |
# I use curly braces to mean vm count, edit to taste | |
if [ $vm_count -eq 1 ]; then | |
echo "{${vm_count}vm}" | |
fi | |
if [ $vm_count -gt 1 ]; then | |
echo "{${vm_count}vms}" |
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
:: install.bat | |
:: | |
:: This script has two functions, and is designed to allow easy development | |
:: of your ArmA3 mission from within a git repository clone | |
:: | |
:: 'install.bat test' - Copies the mission to your local MPMissions folder | |
:: 'install.bat package' - Compiles a PBO for testing with a standlone server | |
:: | |
:: Nick Ludlam 15/7/2013 |
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
#ifdef __RUNNING_FATIGUE__ | |
private["_cumulativePlayerFatigue", "_maxEntries", "_sleepInterval", "_fatigueRecoveryLevel", "_fatigueWarningThreshold", "_fatigueExhaustionThreshold", "_extraThirstDecrement", "_tiredEffectApplied", "_exhaustedEffectApplied", "_msg"]; | |
[] spawn { | |
//diag_log format ["DEBUG: Starting fatigue checks"]; | |
// We sample every _sleepInterval, and keep _maxEntries samples in total. An average is calculated, | |
// and then we determine if its over _fatigueWarningLevel or _fatigueExhaustionThreshold |
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
/* DynamicWeatherEffects.sqf version 1.01 by Engima of Ostgota Ops | |
* Description: | |
* Script that generates dynamic (random) weather. Works in single player, multiplayer (hosted and dedicated), and is JIP compatible. | |
* Arguments: | |
* [_initialFog]: Optional. Fog when mission starts. Must be between 0 and 1 where 0 = no fog, 1 = maximum fog. -1 = random fog. | |
* [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 and 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast. | |
* [_initialRain]: Optional. Rain when mission starts. Must be between 0 and 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than or equal to 0.75). | |
* [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector and z is the other. x and z must be greater than or equal to 0. [-1, -1] = random wind. | |
* [_debug]: Optional. true if debug text is to be shown, otherwise false. | |
*/ |
OlderNewer