Skip to content

Instantly share code, notes, and snippets.

View clasense4's full-sized avatar
🎯
Focusing

Fajri Abdillah clasense4

🎯
Focusing
View GitHub Profile
@clasense4
clasense4 / combine_md.sh
Created October 8, 2013 01:42
Simple Markdown combine
rm body.html
markdown index.md > body.html
cat head.html body.html tail.html > index.html
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@clasense4
clasense4 / head.html
Created October 8, 2013 02:03
Simple Head script for markdown, got css from here (https://gist.github.com/andyferra/2554919)
<html>
<head>
<title></title>
<style>
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
@clasense4
clasense4 / tail.html
Created October 8, 2013 02:08
Simple html tail file
</body>
</html>
@clasense4
clasense4 / Multi regex file
Created October 9, 2013 10:42
Simple Regex
phpName="UserID" => phpName.\"[a-z]*\"
@clasense4
clasense4 / gist:9032552
Created February 16, 2014 11:04
Install scrapy 0.18.4 on centos6.5 Python 2.6.6
yum install libxml2-devel
yum install libxslt-devel
yum install python-devel
pip install MySQL-python
pip install scrapy==0.18.4
@clasense4
clasense4 / monit
Last active April 28, 2016 11:59
Fresh Install monit from 0 Centos 6.5
#!/bin/bash
#
# Init file for Monit system monitor
# Written by Stewart Adam <[email protected]>
# based on script by Dag Wieers <[email protected]>.
#
# chkconfig: - 98 02
# description: Utility for monitoring services on a Unix system
#
# processname: monit
@clasense4
clasense4 / client_upload.php
Last active August 29, 2015 13:57
File Upload Saving dapodik
<?php
/**
* Client Side Upload
* AT : Server VPS Nufaza CloudKilat
* IP : 103.23.20.154
* PATH : /var/www/adminer/upload.php
*/
set_time_limit(600);
$file_name_with_full_path = realpath('./tesfile.txt');
// echo $file_name_with_full_path;
protected function addForeignKeys(Table $table)
{
$database = $table->getDatabase();
$stmt = $this->dbh->query("SELECT ccu1.TABLE_NAME, ccu1.COLUMN_NAME, ccu2.TABLE_NAME AS FK_TABLE_NAME, ccu2.COLUMN_NAME AS FK_COLUMN_NAME, ccu1.CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu1 INNER JOIN
INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc1 ON tc1.CONSTRAINT_NAME = ccu1.CONSTRAINT_NAME AND
CONSTRAINT_TYPE = 'Foreign Key' INNER JOIN
INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 ON rc1.CONSTRAINT_NAME = tc1.CONSTRAINT_NAME INNER JOIN
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu2 ON ccu2.CONSTRAINT_NAME = rc1.UNIQUE_CONSTRAINT_NAME