Skip to content

Instantly share code, notes, and snippets.

@ggeorgaras
ggeorgaras / bullets.html
Created November 14, 2012 14:48 — forked from mrsweaters/bullets.html
Orbit Custom Bullets
<ul class="orbit-bullets">
<li class="has-thumb active" style="background-image: url(/path/to/bullets/bullet-one.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">1</li>
<li class="has-thumb" style="background-image: url(/path/to/bullets/bullet-two.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">2</li>
<li class="has-thumb" style="background-image: url(/path/to/bullets/bullet-three.jpg); background-position: initial initial; background-repeat: no-repeat no-repeat; ">3</li>
</ul>
@ggeorgaras
ggeorgaras / 0_reuse_code.js
Created October 23, 2013 11:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
.navbar-inner,
.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner,
.navbar-static-top .navbar-inner {
background: none;
border: none;
-webkit-border-radius: 0;
border-radius: 0;
-moz-box-shadow: none;
-webkit-box-shadow: none;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Local Storage Example</title>
<!-- include Bootstrap CSS for layout -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<?php
class Encryption {
var $skey = "yourSecretKey"; // change this
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);
return $data;
}
@ggeorgaras
ggeorgaras / gist:c9c4a2ba34b8b9a16136
Created November 20, 2015 10:43 — forked from shazdeh/gist:7949549
Respect sticky posts in category requests
<?php
function putStickyOnTop( $posts ) {
global $wp_query;
if( $wp_query->is_category() ){
$sticky_posts = get_option('sticky_posts');
$num_posts = count( $posts );
$sticky_offset = 0;
//loop over posts and relocate stickies to the front
@ggeorgaras
ggeorgaras / app.js
Created January 15, 2016 22:23 — forked from twilson63/app.js
AngularJS Contact Form Example
function ContactCtrl($scope, $http) {
$scope.success = false;
$scope.httpError = false;
$scope.send = function() {
var job = { job: { klass: 'msg', args: [$scope.msg]}};
$http.post('/contact',job).
success(function(data){
$scope.success = true;
$scope.msg = {};
@ggeorgaras
ggeorgaras / Linux Static IP
Created April 7, 2016 10:39 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@ggeorgaras
ggeorgaras / gist:84649abe6d84fd0d15da59bba84e2d32
Created April 8, 2016 05:44
Upgrading PHP 5.3.3 to 5.4.x in CentOS 6.7
#Install epel
yum install epel
#or you can do this with wget
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
#Install remi
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm
@ggeorgaras
ggeorgaras / gist:56e37c830c0837aac7dace1765b45b97
Created April 8, 2016 07:12
Shared upload folder in wordpress multisite
/**
* Force all network uploads to reside in "wp-content/uploads", and by-pass
* "files" URL rewrite for site-specific directories.
*
* @link http://wordpress.stackexchange.com/q/147750/1685
*
* @param array $dirs
* @return array
*/
function wpse_147750_upload_dir( $dirs ) {