Skip to content

Instantly share code, notes, and snippets.

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@AtomicSmash
AtomicSmash / Big Dump
Last active December 16, 2015 05:19
Amazing script original written by Alexey Ozerov (alexey at ozerov dot de) http://www.ozerov.de/bigdump
<?php
error_reporting(E_ALL);
// BigDump ver. 0.35b from 2012-12-26
// Staggered import of an large MySQL Dump (like phpMyAdmin 2.x Dump)
// Even through the webservers with hard runtime limit and those in safe mode
// Works fine with Internet Explorer 7.0 and Firefox 2.x
// Author: Alexey Ozerov (alexey at ozerov dot de)
@AtomicSmash
AtomicSmash / zip-exclude
Last active December 16, 2015 15:49
SSH - zip while exluding certain folders
zip -r backup.zip $target -x "folder/to/exclude*" "another/folder/to/exclude*"
@AtomicSmash
AtomicSmash / Wordpress transient
Last active December 16, 2015 17:09
A simple transient testing setup. Saves the current time in the DB and resets it after 5 mins
//Get transient value. If it's expired it will return jolly sod all...
$teat = get_transient( 'cool_cache_name');
//See what's in the variable
if($teat == ""){
//Add the current time as a new transient, good value for testing.
//300 is equal to 5 minute - 60*60*12 is 12 hours
set_transient( 'cool_cache_name', date('G:i'), 300 );
echo(date('G:i'));
}else{
@AtomicSmash
AtomicSmash / MYSQL DUMP
Last active December 19, 2015 12:29
MYSQL DUMP
sudo /Applications/MAMP/Library/bin/mysqldump -u root -p DATABASE > /SQL/backup.sql
@AtomicSmash
AtomicSmash / MYSQL IMPORT
Created July 9, 2013 08:20
MYSQL IMPORT
sudo /Applications/MAMP/Library/bin/mysql -u root -p DATABASE < /SQL/backup.sql
@AtomicSmash
AtomicSmash / password-alert
Created July 18, 2013 07:34
Hide wordpress password alert
//disable password nag
function stop_password_nag( $val ){
return 0;
}
add_filter( 'get_user_option_default_password_nag' ,'stop_password_nag' , 10 );
@include font-face('Name', font-files(
"filename.woff", woff,
"filename.ttf", truetype,
"filename.svg", svg),
$weight:normal,
$style:normal);
@AtomicSmash
AtomicSmash / wp-dropbox-sync.sh
Last active December 23, 2015 18:39
Sync to and from the uploads folder and database of a local Wordpress site to Dropbox
#!/bin/bash
#get folder name
echo "Enter the root folder name of Wordpress"
read name
#Get the database details from wp-config file
WPDBNAME=`cat ~/Sites/$name/wp-config.php | grep DB_NAME | cut -d \' -f 4`
@AtomicSmash
AtomicSmash / get-local-authories.php
Last active December 24, 2015 19:49
INCOMPLETE - So far this script grabs local authority information from openlylocal.com, then output the address and turn the postcode into an array.
<?php
$xml=simplexml_load_file("http://openlylocal.com/councils/all.xml");
echo "<pre>";
//print_r($xml);
echo "</pre>";