This file contains hidden or 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
| - (BOOL)connectedToNetwork { | |
| NSURL* url = [[NSURL alloc] initWithString:@"http://google.com/"]; | |
| NSData* data = [NSData dataWithContentsOfURL:url]; | |
| if (data != nil) | |
| return YES; | |
| return NO; | |
| } |
This file contains hidden or 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
| <?php | |
| // From a StackOverflow answer... | |
| // I can't find the original link :-( | |
| class StringEncryption { | |
| const ENCRYPTION_KEY = "She's a killer queeeeeeeeen!"; | |
| public function encode($url = '') { | |
| return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(self::ENCRYPTION_KEY), $url, MCRYPT_MODE_CBC, md5(md5(self::ENCRYPTION_KEY)))); | |
| } |
This file contains hidden or 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
| # Running on iPhone 5s | |
| xcodebuild test -scheme YOUR_PROJECT_NAME -destination 'platform=iOS Simulator,name=iPhone 5s' |
This file contains hidden or 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
| 'use strict'; | |
| var keypress = require('keypress'); | |
| var Drone = require('rolling-spider'); | |
| var colors = require('colors'); | |
| // Change this with your drone name... | |
| var DRONE_NAME = 'RS_W123456'; | |
This file contains hidden or 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
| if (ACTIVE && key) { | |
| // Takeoff | |
| if (key.name === 't') { | |
| try { | |
| d.takeOff(function() { | |
| console.log('[INFO] Rolling Spider take-off completed'.green); | |
| }); | |
| } catch(err) { | |
| console.log('[ERROR] '.red + err.red); | |
| } |
This file contains hidden or 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
| #include <stdio.h> | |
| int main() | |
| { | |
| printf("Hello, World!\n"); | |
| } |
This file contains hidden or 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
| /**************************************************************/ | |
| /* Trigger jumping if needed, also variable height jump logic */ | |
| Man_JumpTrigger() | |
| { | |
| if ( Man.JumpFudge ) | |
| { | |
| Man.JumpFudge--; | |
| } |
This file contains hidden or 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
| curl http://w3.org/ -d "hello=world&foo=bar" --trace-ascii /dev/stdout | |
| == Info: Trying 128.30.52.45... | |
| == Info: Connected to w3.org (128.30.52.45) port 80 (#0) | |
| => Send header, 140 bytes (0x8c) | |
| 0000: POST / HTTP/1.1 | |
| 0011: Host: w3.org | |
| 001f: User-Agent: curl/7.43.0 | |
| 0038: Accept: */* | |
| 0045: Content-Length: 19 |
This file contains hidden or 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
| # Installa git | |
| sudo apt-get update | |
| sudo apt-get install git | |
| # Clona il repo di letsencrypt.org | |
| sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
| # Crea il certificato per il tuo dominio | |
| cd /opt/letsencrypt | |
| ./letsencrypt-auto --apache -d tuodominio.it |
This file contains hidden or 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
| private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) { | |
| if (fromIndex > toIndex) | |
| throw new IllegalArgumentException("fromIndex(" + fromIndex + | |
| ") > toIndex(" + toIndex+")"); | |
| if (fromIndex < 0) | |
| throw new ArrayIndexOutOfBoundsException(fromIndex); | |
| if (toIndex > arrayLen) | |
| throw new ArrayIndexOutOfBoundsException(toIndex); | |
| } |
OlderNewer