Skip to content

Instantly share code, notes, and snippets.

View napolux's full-sized avatar
🇮🇹
Hello from Italy!

Francesco Napoletano napolux

🇮🇹
Hello from Italy!
View GitHub Profile
#include <stdio.h>
int main()
{
printf("Hello, World!\n");
}
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);
}
@napolux
napolux / connect.js
Created September 29, 2015 18:08
Connecting to a Parrot Rolling Spider Drone with Node.js
'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';
@napolux
napolux / gist:796c120d7868e1749c09
Created February 25, 2015 15:19
Run iOS tests from shell, Xcode 6
# Running on iPhone 5s
xcodebuild test -scheme YOUR_PROJECT_NAME -destination 'platform=iOS Simulator,name=iPhone 5s'
@napolux
napolux / StringEncryption.php
Last active January 8, 2022 16:55
Simple reversible encryption
<?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))));
}
@napolux
napolux / gist:4573698
Created January 19, 2013 17:06
Connection check in iOS: the simple way.
- (BOOL)connectedToNetwork {
NSURL* url = [[NSURL alloc] initWithString:@"http://google.com/"];
NSData* data = [NSData dataWithContentsOfURL:url];
if (data != nil)
return YES;
return NO;
}