apt-get install ghostscript
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
git ls-files | xargs wc -l |
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
// showRSS scheduler rss feed parse and download magent link files for your personal showRSS RSS URL | |
// HOW TO USE // | |
// 1. Setup showRss Feed and get a personal URL | |
// 2. Setup a torrent downloader (I like Deluge) and have it watch a folder to auto-add torrent_files | |
// 3. Cron to setup | |
// * 23 * * * nodejs /usr/bin/showrss_downloader.js >> /var/log/showrss_downloader.log 2>&1 |
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
# Elementary OS install nvidia graphics drivers | |
## remove old drivers | |
sudo apt autoremove nvidia* | |
## install new drivers | |
sudo ubuntu-drivers autoinstall |
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
using System.Net.Http; | |
using (var client = new HttpClient()) | |
{ | |
var url = "http://google.com/api-example"; | |
var response = client.GetAsync(url).Result; | |
if (response.IsSuccessStatusCode) | |
{ | |
// by calling .Result you are performing a synchronous call |
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
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSURL *bundleURL = [[NSBundle mainBundle] bundleURL]; | |
NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:bundleURL | |
includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey] | |
options:NSDirectoryEnumerationSkipsHiddenFiles | |
errorHandler:^BOOL(NSURL *url, NSError *error) | |
{ | |
NSLog(@"[Error] %@ (%@)", error, url); | |
}]; |
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
/** | |
* Calculate the center/average of multiple GeoLocation coordinates | |
* Expects an array of objects with .latitude and .longitude properties | |
* | |
* @url http://stackoverflow.com/a/14231286/538646 | |
*/ | |
function averageGeolocation(coords) { | |
if (coords.length === 1) { | |
return coords[0]; | |
} |
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
Update nodejs to latest version: | |
sudo npm install -g n | |
sudo n latest | |
Update npm to latest version: | |
sudo npm install -g npm | |
Do what @runcible suggested | |
hash -d npm |
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
echo "username ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers |
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
# | |
# Download a great Gnu Screen config straight to your current user's environment | |
# | |
# Just paste that in wherever env you're at and run `screen` and you'll have a good configuration with a status bar, | |
# tabs, no warning screen, beeps/bells/alerts, and more. | |
# | |
# Screen Config (.screenrc) located here: | |
# Gist: https://gist.github.com/dantheman213/8df6fabb1bc6fc192c9e | |
# Raw: https://gist.githubusercontent.com/dantheman213/8df6fabb1bc6fc192c9e/raw/bfd65a3695974b94223849c516b5b58828932613/Great%2520GNU%2520Screen%2520config |