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
function calcCrow(lat1, lon1, lat2, lon2) { | |
var R = 6371; // km | |
var dLat = toRad(lat2 - lat1); | |
var dLon = toRad(lon2 - lon1); | |
var lat1 = toRad(lat1); | |
var lat2 = toRad(lat2); | |
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + | |
Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); |
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
/** | |
* FontAwesome Selection Input | |
* | |
* This will extend a select input into a font awesome icon selector. | |
* | |
* @author Matthew Dunham <[email protected]> | |
* @copyright Hot Coffey Design 2018 - http://hotcoffeydesign.com/ | |
*/ | |
(function($){ |
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
/** | |
* To use just login to your WHM and go to MultiPHP Manager. | |
* This is where all FPM pool options are defined. Just copy the code below | |
* and paste it into your browsers dev tools console. | |
* | |
* To change the FPM Pool confs after you've pasted the code into your console and pressed enter to run it. | |
* You can then tell it to change the confs here is the code to execute the process: | |
* | |
* Documentation: window.setFpmPools('[MAX CLIENTS]', '[IDEL TIMEOUT]', '[MAX REQUESTS]'); | |
* Real Example: window.setFpmPools( '5' , '15' , '100' ); |
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
/** | |
Takes this output from CakePHP: | |
<div class="row"> | |
<div class="col-md-2"> | |
<select name="scheduled_start[year]" class="form-control"><option ...></select> | |
</div> | |
<div class="col-md-2"> | |
<select name="scheduled_start[month]" class="form-control"><option ...></select> |
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
var urlList = [], xmlhttp = [null, null]; | |
[].map.call(document.querySelectorAll('#listaccts tr'), function(e){ | |
var | |
domain = e.querySelector(':scope a[title^="Browse to the"]'), | |
username = e.querySelector(':scope > td:nth-child(5)'), | |
account = []; | |
if (username) account.push(username.innerText); | |
if (domain) account.push(domain.getAttribute('href')); |
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
/* _GlobalPrefix_ */ | |
this.gbar_ = this.gbar_ || {}; | |
(function(_) { | |
var window = this; | |
/* _Module_:syf */ | |
try { | |
var Gk = function(a) { | |
if (a instanceof _.ue) | |
return a; | |
if ("function" == typeof a.oc) |
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
/** | |
* Delete all LinkedIn Messages Bookmark | |
* Create a new bookmark in your bookmark bar named: Clean LinkedIn Inbox | |
* Set the url of the bookmark to everything the code below on line 7 | |
*/ | |
javascript:(function(b,c){var d=0,f=function(){var k=b('a[href^="/messaging/thread/"]',!0);k[d]?(k[d].click(),setTimeout(g,c)):(console.log('All Done :)'),location.reload())},g=function(){var k=h,l=b('a[title="Show conversation details"]');l?l.click():(d++,k=f),setTimeout(()=>k(),c)},h=function(){var k=b('[data-control-name="clear_conversation"]');k&&k.click(),setTimeout(j,c)},j=function(){var k=b('[data-control-name="clear_conversation_confirm"]');k&&k.click(),setTimeout(f,c)};f()})(function(b,c){return c?document.querySelectorAll(b):document.querySelector(b)},1000); | |
// Now you can navigate to your linkedin.com inbox and then | |
// click your new bookmark to begin cleaning your inbox. |
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
!function() { | |
"use strict"; | |
function t(t) {} | |
function e(t, e, n, r) { | |
void 0 === r && (r = !0); | |
var i = 3 | |
, o = function(e) { | |
if (0 === i--) | |
return Promise.reject("Hit redirect limit when attempting to fetch " + e + "."); | |
var n = t.adapter.newRequest(e); |
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
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
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
# Backup | |
cp -rpf /var/named /var/named.backup | |
# Find and Replace | |
replace "find_something" "replace_with" -- /var/named/*.db | |
# Generate New Serial | |
grep "serial, todays" /var/named/*.db | sed "s/://g" | cut -d/ -f4 | awk {'system("replace "$2" "strftime("%Y%m%d")"00 -- /var/named/"$1)'} |
NewerOlder