Skip to content

Instantly share code, notes, and snippets.

View banago's full-sized avatar

Baki Goxhaj banago

View GitHub Profile
@banago
banago / mysqlcheck.md
Created February 13, 2016 10:48 — forked from francois-blanchard/mysqlcheck.md
Check and Repair MySQL Tables Using Mysqlcheck

Check and Repair MySQL Tables Using Mysqlcheck

Check a Specific Table in a Database

$ mysqlcheck -c database_name table_name -u root -p

Check All Tables in a Database

#!/bin/bash
# This script creates a new project (or site) under /var/sites and creates
# new virtual host for that site. With the options a site can also
# install the latest version of Laravel directly.
# This script was originally based on the following script by @Nek from
# Coderwall: https://coderwall.com/p/cqoplg
# Display the usage information of the command.
create-project-usage() {
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@banago
banago / gist:3260741
Created August 5, 2012 00:10 — forked from JeffreyWay/gist:3185773
PHP Installation Options
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
@banago
banago / the_includes.html
Created June 9, 2012 17:38 — forked from linssen/the_includes.html
Extending the jQuery Sortable With Ajax & MYSQL
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel='stylesheet' href='styles.css' type='text/css' media='all' />
@banago
banago / presentationPrep.js
Created April 6, 2012 22:28 — forked from JeffreyWay/presentationPrep.js
I wish it could be that simple. Something for me to build.
presentation
.title('My Great Presentation')
.slide({
title: 'Learn About Borders',
bullets: [
'Thing 1',
'Thing 2',
],
code: ['path/to/file.css', [2,4]] // path to file, lines to grab
@banago
banago / gist:1790188
Created February 10, 2012 15:13 — forked from technosailor/gist:1771566
Oboject Oriented WordPress Ajax API usage
<?php
/*
Plugin Name: Test
*/
class My_Like_Button {
function __construct()
{
$this->hooks();
}
@banago
banago / gist:1292885
Created October 17, 2011 15:35 — forked from billerickson/gist:1243289
Get images marked "Include in Rotator"
<?php
// Get all images attached to post that have "Include in Rotator" marked as "Yes"
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'post_status' => 'inherit',
'posts_per_page' => '-1',
'order' => 'ASC',
@banago
banago / gist:1292884
Created October 17, 2011 15:35 — forked from billerickson/gist:1243276
Include In Rotator option in Media Uploader
<?php
/**
* Add "Include in Rotator" option to media uploader
*
* @param $form_fields array, fields to include in attachment form
* @param $post object, attachment record in database
* @return $form_fields, modified form fields
*/
@banago
banago / gist:1292878
Created October 17, 2011 15:33 — forked from billerickson/gist:1243250
Photo Credit Fields in Media Gallery
<?php
/**
* Add Photographer Name and URL fields to media uploader
*
* @param $form_fields array, fields to include in attachment form
* @param $post object, attachment record in database
* @return $form_fields, modified form fields
*/