Skip to content

Instantly share code, notes, and snippets.

View hoanganh25991's full-sized avatar

Anh Le hoanganh25991

  • https://originallyus.sg
  • Vietnam
View GitHub Profile
@hoanganh25991
hoanganh25991 / sumit-button.html
Created October 29, 2015 15:08
#html #submit-button #button
<input type="submit" value="Go to my link location"
onclick="window.location='/my/link/location';" />
@hoanganh25991
hoanganh25991 / main.blade.php
Created October 30, 2015 03:59
Laravel view main-blade layout
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Learning Note</title>
{{ HTML::style('css/style.css'); }}
</head>
<body>
<div id="header">
<h1>Welcome to Hoang Anh'note</h1>
@hoanganh25991
hoanganh25991 / database_open-connect.php
Last active October 30, 2015 10:00
#php-raw #PDO #database
<?php
$dbInfo = "mysql:host=localhost;dbname=simple_blog";
$dbUser = "root";
$dbPassword = "";
$db = new PDO( $dbInfo, $dbUser, $dbPassword );
$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
@hoanganh25991
hoanganh25991 / database_save-entry.php
Last active October 30, 2015 10:00
#php-raw #database #save-entry #save
<?php
function saveEntry ( $title, $content ) {
global $db;
$entrySQL = "INSERT INTO php_raw_post ( post_title, post_content ) VALUES ( ?, ?)";
$entryStatement = $db->prepare( $entrySQL );
$formData = array( $title, $content );
$entryStatement = makeStatement( $entrySQL, $formData );
return $db->lastInsertId();
}
function makeStatement ( $sql, $data = null ){
@hoanganh25991
hoanganh25991 / create-table.sql
Created October 31, 2015 06:06
#SQL #create-table
CREATE TABLE php_raw02_post(
id int(11) PRIMARY KEY AUTO_INCREMENT,
title varchar(100) not null,
content varchar(2000) not null
)
@hoanganh25991
hoanganh25991 / namespace-use.php
Last active October 31, 2015 08:35
#php #namespace #use
//Inside folder models, we have PageData.class.php:
<?php
namespace models;
class PageData{
public $navigationBar = "";
public $main = "";
}
?>
//Inside other file, we want to use this class
@hoanganh25991
hoanganh25991 / index.html
Last active November 2, 2015 01:04
#viewport #CSS #scale #responsive
<nav class="topnav">
<button class="menu">☰</button>
</nav>
<div class="mainmenu open">
<div class="innermenu">
<nav>
<h2>Click One</h2>
<ul>
<li><a target="_blank" href="http://codepen.io/mwmwmw/full/03fd8da9b8736277dee5714878bca4f2/" title="Leonardo">Leonardo</a></li>
<li><a target="_blank" href="http://codepen.io/mwmwmw/full/03fd8da9b8736277dee5714878bca4f2/" title="Michaelangelo">Michaelangelo</a></li>
@hoanganh25991
hoanganh25991 / index.html
Created November 4, 2015 04:10
jQuery Live Search Basic Example
<ul class="live-search-list">
<input type="text" class="live-search-box" placeholder="search here" />
<li>Lorem</li>
<li>ipsum</li>
<li>dolor</li>
<li>sit</li>
<li>amet</li>
</ul>
@hoanganh25991
hoanganh25991 / list-style.php
Created November 4, 2015 05:49
list style with CSS
<!doctype html>
<html>
<head>
<title>CSS3 ordered list styles - demo</title>
<style>
body{
margin: 40px auto;
width: 500px;
}
@hoanganh25991
hoanganh25991 / list-style02.php
Created November 4, 2015 05:56
list style with CSS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example: 5 Ways to Style Unordered Lists</title>
<style>
html {
background-color: #ddd; }
body {
background-color: #fff;