Skip to content

Instantly share code, notes, and snippets.

View jcchikikomori's full-sized avatar

John Cyrill Corsanes jcchikikomori

View GitHub Profile
@jcchikikomori
jcchikikomori / sql_import.php
Created October 7, 2015 05:20 — forked from b4oshany/sql_import.php
PHP PDO sql file import.
<?php
namespace libs\mysql;
class PDODbImporter{
private static $keywords = array(
'ALTER', 'CREATE', 'DELETE', 'DROP', 'INSERT',
'REPLACE', 'SELECT', 'SET', 'TRUNCATE', 'UPDATE', 'USE',
'DELIMITER', 'END'
);
<!DOCTYPE HTML 4.01 Transitional>
<html>
<head></head>
<body bgcolor="#33FFFF">
<style type="text/css">
form {background-color: pink; box-shadow: 10px 10px #000;}
</style>
<body>
<form style = "padding: 20px; width: 215px; border: 5px solid purple; border-radius: 8px; margin: 0 auto; margin-top: 60px;" id="form">
@jcchikikomori
jcchikikomori / UUID.php
Created January 30, 2016 07:35 — forked from dahnielson/UUID.php
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@jcchikikomori
jcchikikomori / pagination.php
Created March 27, 2016 13:17 — forked from spikensbror/pagination.php
Pagination collapse algorithm.
<?php
$pages = 20;
$padding = 3;
$dedicated = 4;
function paginate($page)
{
global $pages;
global $padding;
@jcchikikomori
jcchikikomori / geojson.php
Created April 20, 2016 14:09 — forked from wboykinm/geojson.php
Sample PHP to Point GeoJSON
<?php
/**
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON
*/
# Connect to MySQL database
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword');
# However the User's Query will be passed to the DB:
$sql = 'SELECT * from GDA_database WHERE user_query = whatever';
@jcchikikomori
jcchikikomori / realpage_config.json
Created July 6, 2016 10:38 — forked from anonymous/config.json
Bootstrap Customizer Config for REALPAGE
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@jcchikikomori
jcchikikomori / timeline.css
Created August 10, 2016 10:42 — forked from LibertysYarn/timeline.css
Responsive Timeline - Bootstrap 3
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
@jcchikikomori
jcchikikomori / .gitconfig
Created November 2, 2016 08:59 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@jcchikikomori
jcchikikomori / mysql2sqlite.sh
Created March 10, 2017 03:39 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jcchikikomori
jcchikikomori / node-and-npm-in-30-seconds.sh
Created March 17, 2017 11:29 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh