Skip to content

Instantly share code, notes, and snippets.

class MYPDF extends TCPDF {
protected $is_last_page = false;
//Page header
public function Header() {
// Logo
$image_file = K_PATH_IMAGES.'logo_example.jpg';
$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
// Set font
@eyohansa
eyohansa / package.json
Created February 18, 2016 18:14
Express with EJS package.
{
"name": "express-ejs",
"main": "server.js",
"scripts": {
"app": "nodemon server"
},
"dependencies": {
"body-parser": "^1.15.0",
"cookie-parser": "^1.4.1",
"ejs": "^2.4.1",
@eyohansa
eyohansa / server.js
Created February 18, 2016 18:12
Basic Express with EJS
var express = require("express");
var app = express();
var port = 8082;
var cookieParser = require("cookie-parser");
var bodyParser = require("body-parser");
app.use(express.static(__dirname + "/public"));
app.use(morgan("dev"));
app.use(bodyParser);
@eyohansa
eyohansa / dice_game.py
Last active January 21, 2016 03:29
A simulation of dice game where players race to empty their bowl of dice.
# author: Eric Yohansa
import random
NUM_OF_PLAYERS = 4
NUM_OF_DICE = 6
class Game():
@eyohansa
eyohansa / 0_reuse_code.js
Created January 5, 2016 04:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console