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 / .bash_profile
Created April 25, 2015 10:16
My bash profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (git \1)/'
}
export PS1="\\n\D{%F %T} \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h \[\033[33;1m\]\w\[\033[m\] \$(parse_git_branch)\n\$ "
export CLICOLOR=1
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\007"'
@adrian7
adrian7 / gist:284fe21fc27336df6555
Created January 19, 2015 21:00
Notepad bookmarklet
data:text/html, <html style="font-family:'Open Sans', 'Trebuchet MS', Verdana, Arial, sans-serif; background:#222; color:#fff;font-size:58px;" contenteditable>
@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 )
@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 / 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 / sample.json
Created June 28, 2014 12:09
Sample JSON
{"success":1}
@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 / 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 / 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/
;