Skip to content

Instantly share code, notes, and snippets.

View ceceprawiro's full-sized avatar

Cecep Prawiro ceceprawiro

View GitHub Profile
@ceceprawiro
ceceprawiro / mysqldump.sh
Created February 4, 2015 10:18
Backup (mysql dump) all your MySQL databases in separate files
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_DIR="/backup/$TIMESTAMP"
MYSQL_USER="root"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="root"
MYSQLDUMP=/usr/bin/mysqldump
mkdir -p "$BACKUP_DIR/mysql"
@ceceprawiro
ceceprawiro / index.html
Created December 30, 2014 14:21
Stupid Grid System
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
<title>Grid</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
<style>
/** reset */
@ceceprawiro
ceceprawiro / vhost.sh
Last active July 27, 2022 11:38
chmod +x /path/to/vhost.sh
#!/bin/sh
usage() {
echo "Usage: ./vhost.sh create|remove <PROJECT> [-r<DOMAIN>]"
exit
}
create() {
# Setup variables
DIR=$1
@ceceprawiro
ceceprawiro / admin.html
Created September 22, 2014 11:41
Base Structure for Admin Page
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
display: block;
height: 100%;
padding: 0;
margin: 0;
}
@ceceprawiro
ceceprawiro / class.database.php
Last active August 29, 2015 14:06
A very simple example how to use mysqli
<?php
/**
* Class Database using mysqli
*
* @link https://gist.github.com/ceceprawiro/4f8072ffa3ee412f2f13
* @author Cecep Prawiro
*/
class Database
{
@ceceprawiro
ceceprawiro / base.css
Last active August 29, 2015 14:06
Base Stylesheet
/*!
* HTML Base Stylesheet v.1.0 | gist.github.com/ceceprawiro/28b1813fe589648712ac
*
* HTML5 Reset | github.com/murtaugh/HTML5-Reset
* Normalize v3.0.1 | MIT License | git.io/normalize
* HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/
*/
/**
* Let's default this puppy out.
<?php
/**
* Display human-readable information from a variable
*
* @param mixed $expression The expression to be displayed
* @param boolean $function The function will use
* @param boolean $stop Stop after displayed
* @return void
*/
@ceceprawiro
ceceprawiro / Session.php
Created September 6, 2014 20:23
Session library for CodeIgniter
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Code Igniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author Dariusz Debowczyk
* @copyright Copyright (c) 2006, D.Debowczyk