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
double getDistance(int rssi, int txPower) { | |
return Math.pow(10d, ((double) txPower - rssi) / (10 * 2)); | |
} |
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
#!/bin/bash | |
# Name of your app. | |
APP="YourApp" | |
# The path of your app to sign. | |
APP_PATH="/path/to/YourApp.app" | |
# The path to the location you want to put the signed package. | |
RESULT_PATH="~/Desktop/$APP.pkg" | |
# The name of certificates you requested. | |
APP_KEY="3rd Party Mac Developer Application: Company Name (APPIDENTITY)" |
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
/* JS INECTION CODE */ | |
if(typeof Checkout === 'object'){ | |
if(typeof Checkout.$ === 'function'){ | |
/* your super duper code in here, such as: */ | |
document.getElementById('payment_gateway_36437000235_description').innerHTML += "<a href='https://greenbyphone.com/eCheck/eCheck.aspx?GreenButton_id=13462&TransactionID='><img src='https://greenbyphone.com/eCheck/images/PayNowButton.png' border='0' alt='' /></a>"; | |
var element = document.getElementById("payment_gateway_36437000235_description'"); | |
element.classList.remove("visually-hidden"); | |
} | |
} | |
/* END JS INECTION CODE */ |
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
<a data-href="RdcDovL1N0YWdpbmc...base64...hhcmRpbmctaGVycmVuLWhlbaQtMTgyMDg3" | |
href="#">Link</a> | |
<script> | |
<!-- | |
var _dlist = document.getElementsByTagName('A'); | |
for(i=0;i<_dlist.length;i++) { | |
var _data = _dlist[i].getAttribute( 'data-href' ); | |
if( _data !== 'null' ) { |
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 | |
/* | |
Plugin Name: Mask Outbound Links | |
Plugin URI: http://www.christopherguitar.net/ | |
Description: Masks outbound links behind a redirect | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.net/ | |
License: GPL2 | |
*/ |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^index\.php$ - [L] | |
RewriteRule (.*) ./index.php?id=$1 [L] | |
</IfModule> |
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
string sample = "Stargate.SG-1.S01E08.iNT.DVDRip.XviD-LOCK.avi"; | |
Regex regex = new Regex(@"S(?<season>\d{1,2})E(?<episode>\d{1,2})"); | |
Match match = regex.Match(sample); | |
if (match.Success) | |
{ | |
string season = match.Groups["season"].Value; | |
string episode = match.Groups["episode"].Value; | |
Console.WriteLine("Season: " + season + ", Episode: " + episode); | |
} |
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
# you will need to download nzbdrone.db & some type of sqlite editor | |
# First We Will Update The Series Table | |
# Replace the slashes | |
UPDATE Series SET path = replace( path, '\', '/' ) WHERE path LIKE '%:\%'; | |
# K: is the windows drive that your files were on (replace this with whatever drive your files are on, will need to repeat for each | |
# windows root folder you have in Sonnar), /home/new/path/in/linux is well the new path in linux | |
UPDATE Series SET path = replace( path, 'K:', '/home/new/path/in/linux' ) WHERE path LIKE 'K:/%'; | |
# Fix slashes in EpisodeFiles table | |
UPDATE EpisodeFiles SET RelativePath = replace( RelativePath, '\', '/' ) WHERE RelativePath LIKE '%\%'; |
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
#!/bin/bash | |
# | |
# putiodl - put.io cli downloader | |
# | |
# Copyright (C) 2013 Neal <[email protected]> | |
# | |
# Dependencies: jq, curl, wget | |
# | |
# Make sure ~/.putiodl exists and contains your put.io OAuth token. | |
# |
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
#!/bin/bash | |
#requires inotify-tools | |
#apt-get install inotify-tools | |
FOLDER="/home/plex/toupload" | |
inotifywait -m $FOLDER -e create -e moved_to | | |
while read path action file; do | |
echo "The file '$file' appeared in directory '$path' via '$action'" | |
acd_cli ul $FOLDER/"$file" /Media/Unsorted/ |