Skip to content

Instantly share code, notes, and snippets.

@ivanteoh
ivanteoh / 165-exercise.js
Created July 6, 2020 10:42
Javascript: 101 Week 1 Track 1
function stringGuess(aString) {
// 'default' operator
var checkString = aString || "aString is falsy value.";
// 'guard' operator
if (checkString && checkString.length)
return checkString;
return "aString is not a string";
}
var man = 0;
@ivanteoh
ivanteoh / 164-exercise21.js
Created July 6, 2020 10:35
Javascript: 101 Week 1 Track 2
(4 >= 6 || "grass" != "green") && !(12 * 2 == 144 && true)
@ivanteoh
ivanteoh / 163-index.html
Created July 6, 2020 10:24
Javascript: 101 Sign Up
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>JavaScript 101</title>
<script type="text/javascript">
function load()
{
var total = 2 + 2;
alert(total + '');
@ivanteoh
ivanteoh / 128-header.php
Created July 5, 2020 11:31
Adding a Favicon
<link rel="shortcut icon" href="<?php bloginfo('template_directory');
?>/favicon.ico" />
@ivanteoh
ivanteoh / 107-theme.html
Created July 5, 2020 10:12
Convert AVI to OGG Using VLC
<video width="427" height="240" controls="controls">
<!-- Adjust width and height to match your video -->
<source src="video.ogg" type="video/ogg" />
<!-- Firefox 3.5 will play this -->
</video>
@ivanteoh
ivanteoh / 102-index.php
Created July 5, 2020 09:39
WordPress Theme Development 18 - Home Page Template
<?php
/**
* @package WordPress
* @subpackage Your_Theme
*/
/*
Template Name: Home
*/
get_header(); ?>
<div id="container">
@ivanteoh
ivanteoh / 98-index-after.php
Created July 5, 2020 07:48
WordPress Theme Development 17 - Archives Template
<?php
/**
* Customized function for wp_trim_excerpt
*/
function customized_trim_excerpt($text) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
@ivanteoh
ivanteoh / 97-index.php
Created July 5, 2020 07:45
WordPress Theme Development 16 - Page Template
<?php
/**
* @package WordPress
* @subpackage Your_Theme
*/
get_header(); ?>
<div id="container">
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : ?>
@ivanteoh
ivanteoh / 94-functions.php
Created July 5, 2020 07:13
Split Sidebar into Two Divisions
if ( function_exists('register_sidebar') )
{
// Primary Sidebar
register_sidebar(array(
'name' => 'Primary Sidebar',
'id' => 'primary-sidebar',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '',
'after_title' => '',
@ivanteoh
ivanteoh / 91-theme.html
Created July 5, 2020 07:06
Twitter Conversation in WordPress Using Tweetboard
<script type="text/javascript"
src="http://tweetboard.com/tb.js?v=1.0&user=yourtwitterusername"></script>