Skip to content

Instantly share code, notes, and snippets.

View koyoyo's full-sized avatar

Tarongpong Jaratwuttiyakorn koyoyo

View GitHub Profile
@koyoyo
koyoyo / gist:f08fc3d40744a0eac454c51889b26059
Last active June 22, 2017 09:33
Weasyprint fonts usage
  • can use from googlefonts. (Include <link> in html page)
  • can use font-family from os installed fonts.

OSX

cp YOURFONT-regular.ttf, YOURFONT-Bold to /Library/Fonts/

Ubuntu

@koyoyo
koyoyo / UWSGI start error
Created June 10, 2014 04:47
UWSGI start error: /usr/share/uwsgi/init/do_command: line 7: /dev/fd/62: No such file or directory
ln -s /proc/self/fd /dev/fd
@koyoyo
koyoyo / MYSQL Error text long size
Last active August 29, 2015 13:57
MYSQL Error text long size because of have many Text field on table.
DatabaseError: (1118, 'Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.')
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=ON;
ALTER TABLE nombre_tabla
ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=8;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>NBTC</title>
<meta charset="utf-8">
<meta name="keywords" content="" />
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
@koyoyo
koyoyo / [Ubuntu] install mysql
Created April 24, 2013 03:27
[Ubuntu] How to install mysql on Ubuntu 12.04
sudo apt-get install mysql
sudo apt-get install libmysqlclient-dev
@koyoyo
koyoyo / array2xml.php
Last active December 14, 2015 21:09 — forked from nazt/array2xml.php
<?php
function generate_xml_element( $dom, $data ) {
if ( empty( $data['name'] ) )
return false;
// Create the element
$element_value = ( ! empty( $data['value'] ) ) ? $data['value'] : null;
$element = $dom->createElement( $data['name'], $element_value );
// Add any attributes