Skip to content

Instantly share code, notes, and snippets.

View banago's full-sized avatar

Baki Goxhaj banago

View GitHub Profile
@francois-blanchard
francois-blanchard / mysqlcheck.md
Last active July 26, 2020 16:23
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

@ms-studio
ms-studio / wp-gallery-shortcode-override.php
Last active April 17, 2019 14:13
an override of the default WP gallery shortcote
@jasonlewis
jasonlewis / create-project.sh
Last active February 10, 2023 12:04
Bash script that creates a new project and virtual host for that project. Can also be used to quickly create a new Laravel project.
#!/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() {
@theroux
theroux / throttle.js
Created July 17, 2013 15:21
Simple throttling function w/ jQuery
var scrollTimeout;
var throttle = 50;
var scrollMessage = function (message) {
console.log(message);
};
$(window).on('scroll', function () {
if (!scrollTimeout) {
scrollTimeout = setTimeout(function () {
<?php
/**
* Logs messages/variables/data to browser console from within php
*
* @param $name: message to be shown for optional data/vars
* @param $data: variable (scalar/mixed) arrays/objects, etc to be logged
* @param $jsEval: whether to apply JS eval() to arrays/objects
*
* @return none
* @author Sarfraz
@azizur
azizur / README.md
Created August 6, 2012 00:08 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@JeffreyWay
JeffreyWay / gist:3185773
Created July 27, 2012 02:01
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 \
@linssen
linssen / the_includes.html
Created May 23, 2012 08:23
Extending the jQuery Sortable With Ajax & MYSQL
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script><link rel='stylesheet' href='styles.css' type='text/css' media='all' />
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?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.
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})