Skip to content

Instantly share code, notes, and snippets.

View adrian7's full-sized avatar
🦉
cărturar și filozof

Adrian Şilimon-Morariu adrian7

🦉
cărturar și filozof
View GitHub Profile
@adrian7
adrian7 / finder.php
Created August 7, 2012 20:27
Finder.php - find files with php
<style type="text/css">
body, button, input{
font-size:130%;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
</style>
<?php
define('SPATH', dirname(__FILE__));
@adrian7
adrian7 / wpmailbranding.php
Created August 24, 2012 19:16
Changes WP default From: Wordpress <wordpress@yourdomain.tld> emails header
/**
* Changes WP default From: Wordpress <wordpress@yourdomain.tld> emails header
* to From: Blogname <no-reply@yourdomain.tld>. Customizable, drop it in your theme's functions.php to take effect.
* @author Adrian7 (http://adrian.silimon.eu)
*/
function wp_mail_branding($args){
$wp_domain = @parse_url(get_bloginfo('url'));
$wp_domain = $wp_domain['host'];
{
"USD": {
"symbol": "$",
"name": "Dolar american",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "Dolari americani"
},
@adrian7
adrian7 / putty-record
Created December 30, 2013 13:53
AutoIt Script to record the screen using CamStudio during a Putty session
#include <Constants.au3>
;
; AutoIt Script to record the screen using CamStudio during a Putty session
; @author Adrian7 (http://adrian.silimon.eu)
; @Tested on Windows7 only
;
; Links: Putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
; CamStudio - http://camstudio.org/
;
@adrian7
adrian7 / dbexport.php
Last active January 4, 2016 14:28
dbexport.php - instantly exports your WordPress database to a database.sql file;
<?php
/**
* Instantly exports your WordPress database to a database.sql file
* @author Adrian S. (http://amsquared.co.uk/)
* @version 1.0
*
* Usage instructions - supposed your wordpress site is at http://example.com/:
* (1) Edit the line 19 below and put in the there a randomString;
* (2) Upload the file in the root of your WordPress installation (via FTP);
* (3) Point your browser to http://example.com/dbexport.php?secret=randomString
@adrian7
adrian7 / adminemail.php
Created May 31, 2014 09:23
Changes admin_email for a wordpress site; in case you don't have wp-admin access but you have FTP access to it
<?php
include_once 'wp-load.php'; global $wpdb; echo '<pre>';
$SelectSQL = $wpdb->prepare("SELECT * FROM $wpdb->options WHERE `option_name`='admin_email'");
$Row = $wpdb->get_row($SelectSQL);
print_r($Row);
@adrian7
adrian7 / sample.json
Created June 28, 2014 12:09
Sample JSON
{"success":1}
@adrian7
adrian7 / connstatus.html
Created June 28, 2014 13:25
Internet Connection Status - checks your internet connection status
<!doctype html>
<html>
<head>
<title>Internet Connection Status</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"/>
<style type="text/css" media="all">
html,body{
margin:0px;
padding:0px;
background: #222;
@adrian7
adrian7 / connstatus.min.html
Created June 28, 2014 13:26
Internet Connection Status (minified)
<!doctype html><html><head><title>Internet Connection Status</title><link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"/><style type="text/css" media="all">html,body{margin:0px;padding:0px;background: #222;font-size:100%;}label{cursor: pointer;}input[type="checkbox"], input[type="radio"]{position: relative;top: 3px;}.notifier{width:100%;margin: 8% auto;font-family: Verdana, Arial, Helvetica sans-serif;font-size: 350%;color: #FAFAFA;}.notifier p{text-align:center;margin:20px 0px;}.connstatus{font-size: 230%;}.connected{color: #76E635;}.disconnected{color: #E35120;}.settings{font-size:12px;}audio{display: none;}</style></head><body><div class="notifier"><p class="connstatus"></p><p class="ip">0.0.0.0</p><p class="settings"><label><input type="checkbox" checked id="checkPlaySound" value="1"/> play sound</label> &nbsp;&nbsp;&nbsp;<label><input type="checkbox" checked id="checkShowAlert" value="1"/> show alert</label></p></div><audio id="audioAlarm" controls><so
@adrian7
adrian7 / class.viewoptions.php
Created July 4, 2014 13:53
WordPress - class to extract your post meta in the form of an object; more elegant, easier to cache
/**
* wp_view_options - extracts post meta as object members
* @author Adrian S. (http://www.gridwave.co.uk/)
* @version 1.0
*
* Basic usage example:
*
* $view_options = new wp_view_options( get_the_ID() );
* ...
* if( $view_options->background_color )