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 | |
header('Content-type: text/plain'); | |
function checkdomain($domain) { | |
if($domain == '.com' OR $domain == '.de') return false; | |
$api_req = file_get_contents('http://freedomainapi.com/?key=YOURAPIKEY&domain=' . $domain); | |
$api_req = json_decode($api_req, true); | |
return $api_req['available'] == 'true'; | |
} |
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 | |
function checkdomain($domain) { | |
$api_req = file_get_contents('http://freedomainapi.com/?key=YOURAPIKEY&domain=' . $domain); | |
$api_req = json_decode($api_req, true); | |
if($api_req['available'] == 'true') return true; | |
return false; | |
} |
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
var Treetagger = require('treetagger'); | |
var tagger = new Treetagger({ language: "french" }); | |
var fs = require('fs'), filename = "/Users/benni/coding/tt-nodejs/french.txt"; | |
fs.readFile(filename, 'utf8', function(err, data) { | |
if(err) throw err; | |
tagger.tag(data, function (err, results) { | |
results.forEach(function(e) { | |
if(e.pos == "NOM") { | |
console.log(e.t); |
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
nano /etc/network/interfaces | |
iface eth0 inet static | |
address 10.42.4.4 | |
netmask 255.0.0.0 | |
gateway 10.10.10.1 | |
dns-nameservers 10.10.10.1 8.8.8.8 8.8.4.4 | |
dns-search altpeter.me | |
/etc/init.d/networking restart |
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
+ (UIImage *)imageWithColor:(UIColor *)color { | |
CGRect rect = CGRectMake(0, 0, 1, 1); | |
// Create a 1 by 1 pixel context | |
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); | |
[color setFill]; | |
UIRectFill(rect); // Fill it with your color | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return image; |
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
CGFloat red, green, blue, alpha; | |
[color getRed: &red | |
green: &green | |
blue: &blue | |
alpha: &alpha]; | |
NSLog(@"red = %f. Green = %f. Blue = %f. Alpha = %f", | |
red, | |
green, | |
blue, | |
alpha); |
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
#1. Figure out the device name for the new device | |
fdisk -l | |
#This will give you output similar to this: | |
#Disk /dev/sda: 17.2 GB, 17179869184 bytes | |
#255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors | |
#Units = sectors of 1 * 512 = 512 bytes | |
#Sector size (logical/physical): 512 bytes / 512 bytes | |
#I/O size (minimum/optimal): 512 bytes / 512 bytes |
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
find /path/here -name "what to look for" |
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
apt-get update # update repositories first | |
# then do either | |
apt-get dist-upgrade | |
aptitude safe-upgrade # about equiv. to above, safer though | |
# alternative, doesn't install or uninstall any packages | |
apt-get upgrade | |
# reference: http://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade |
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
uname -m |