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
// Bookmarklet: | |
// javascript:(function()%7Bif%20(%20jQuery('%23createuser').length%20)%20%7Bvar%20previous_creds%20%3D%20prompt('Enter%20previous%20setup%20code%20(or%20click%20enter%20to%20skip)'%2C%20'')%3Bvar%20username%20%3D%20false%3Bvar%20email%20%3D%20false%3Bvar%20password%20%3D%20false%3Bvar%20firstname%20%3D%20false%3Bvar%20lastname%20%3D%20false%3Bvar%20website%20%3D%20false%3Bvar%20role%20%3D%20false%3Bif%20(%20previous_creds%20)%20%7Bvar%20creds%20%3D%20jQuery.parseJSON(%20previous_creds%20)%3Bif%20(%20creds%20)%20%7Busername%20%3D%20creds.username%3Bemail%20%3D%20creds.email%3Bpassword%20%3D%20creds.password%3Bif%20(%20creds.firstname%20)%20firstname%20%3D%20creds.firstname%3Bif%20(%20creds.lastname%20)%20lastname%20%3D%20creds.lastname%3Bif%20(%20creds.website%20)%20website%20%3D%20creds.website%3Bif%20(%20creds.role%20)%20role%20%3D%20creds.role%3B%7D%7Dif%20(%20!previous_creds%20%7C%7C%20!username%20%7C%7C%20!email%20%7C%7C%20!password%20)%20%7Bvar%20username%20%3D%20prompt('(Step%201%2F8)%2 |
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 | |
# Upload a backup file to external FTP. Delete local copy if successful. | |
# CONFIGURATION ---------- | |
LOCALPATH='/path/to/backup' | |
HOST='' | |
USER='' | |
PASS='' | |
REMOTEPATH='/remote/storage/path' | |
# RUN PROGRAM ------------ |
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
/* | |
This function allows you to press and drag your mouse over multiple checkboxes to change the state of them all. | |
It does not toggle, but instead causes any selected values to match the originating element. | |
Does not support radio buttons or dynamically loaded elements. | |
Example Usage -- Say you have five checkboxes, with the middle one checked: | |
[0] | |
[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
<?php | |
$recent_weather = get_transient('recent_weather_widget'); | |
if ( !$recent_weather ) { | |
$api_key = 'YOUR_API_KEY'; | |
$lat = '44.052303'; | |
$long = '-123.102148'; | |
$cache_duration = 60*30; // seconds | |
// retrieve weather information from forecast.io |
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
<?php | |
/* | |
Format: | |
array( | |
group_key => ( | |
post_type = TYPES, | |
args = ARGS, | |
fields = FIELDS, |
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
// Converts a (user-pasted) string to a 2d array, utilizing line breaks and tabs. | |
function interpret_table( data ) { | |
var table = data.split("\n"); | |
for (i in table) { | |
table[i] = table[i].split("\t"); | |
} | |
return table; |
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
<?php | |
/* | |
* Overwrites the default environment in /wp-admin/includes/upgrade.php. | |
* | |
* Originally this function will: | |
* 1: Create a category titled "Uncategorized" | |
* 2: Create a post titled "Test Post" | |
* 3: Create a comment by "Mr WordPress" | |
* 4: Create a page called "Sample Page" | |
* 5: Create some widgets for the sidebar |
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
// Allows downloading the background image from the "Earth View from Google Maps" extension for Chrome: | |
// https://chrome.google.com/webstore/detail/earth-view-from-google-ma/bhloflhklmhfpedakmangadcdofhnnoh | |
// | |
// HOW TO USE: | |
// 1. Open a new tab to see your earth view, preferably something you want to download. | |
// 2. Open the javascript console (Ctrl+Shift+J). Note that the regular inspector may freeze due to the large data-uri, so you must go straight to the javascript console. | |
// 3. Paste the following code to the console, which will create a download link above the earth icon in the corner: | |
// 4. Image will open in a new tab when you click the link. You can then save it. | |
var link = document.createElement('a'); |
OlderNewer