Skip to content

Instantly share code, notes, and snippets.

View immanuelsun's full-sized avatar

Immanuel Sun immanuelsun

View GitHub Profile
{
"files":
{
"jquery" : "http://code.jquery.com/jquery.js",
"jquery.min" : "http://code.jquery.com/jquery.min.js",
"jquery-cookie" : "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js",
"jquery-dotimeout" : "https://raw.github.com/cowboy/jquery-dotimeout/master/jquery.ba-dotimeout.min.js",
"jquery-extra-selectors" : "https://raw.github.com/keithclark/JQuery-Extended-Selectors/master/jquery-extra-selectors.js",
"jquery-flexslider" : "https://raw.github.com/mbmufffin/FlexSlider/master/jquery.flexslider-min.js",
"jquery-mediaelement" : "https://raw.github.com/johndyer/mediaelement/master/build/mediaelement-and-player.js",
@immanuelsun
immanuelsun / wp_show.widget.php
Last active August 29, 2015 14:04
wp_show.widget
<div class="row">
<div class="col-md-4">
<?php if(is_active_sidebar( 'front-left' )):
dynamic_sidebar( 'front-left' );
endif;
?>
</div>
<div class="col-md-4">
@immanuelsun
immanuelsun / wp.sidebar.php
Last active August 29, 2015 14:04
Add a template to Wordpress sidebar to use widgets.
<!-- SIDEBAR -->
<div class="col-md-3 sidebar">
<?php if( ! dynamic_sidebar( 'page') ): ?>
<h3 class="l-sidebar-title">Sidebar Setup</h3>
<p>Please add sidebar widgets and display them here.</p>
<?php endif; ?>
</div> <!-- end col-md-3 -->
@immanuelsun
immanuelsun / _typography.scss
Created July 24, 2014 17:40
Basic settings for typography.
body {
color: $c-text;
font: #{$base-font-size}/#{$baseline} $f-404;
}
a {
color: $c-link;
&:hover {
color: $c-hover;
@immanuelsun
immanuelsun / wp_carousel.php
Last active August 29, 2015 14:04
A slideshow using Bootstrap carousel in WordPress.
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@immanuelsun
immanuelsun / scopes.txt
Created October 14, 2015 04:39 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@immanuelsun
immanuelsun / .gitignore
Created December 18, 2015 00:30 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@immanuelsun
immanuelsun / php-strip_zeros_from_date.php
Created March 13, 2016 22:44
PHP: strip zeros from `date()`.
function strip_zeros_from_date($marked_string = "")
{
// remove the marked zeros
$no_zeros = str_replace("*0", "", $marked_string);
// remove any remaining zeros
$cleaned_string = str_replace("*", "", $no_zeros);
return $cleaned_string;
}
@immanuelsun
immanuelsun / customizer.php
Created June 15, 2016 00:30
WordPress customizer: add image upload (logo)
// Add theme customizer controls, settings, etc.
function kingdom_customize_register($wp_customize)
{
/********************************************
! Image Upload
*********************************************/
$wp_customize->add_section('kingdom_image_upload', array(
'title' => __( 'Images', 'kingdom' )
));