Skip to content

Instantly share code, notes, and snippets.

View immanuelsun's full-sized avatar

Immanuel Sun immanuelsun

View GitHub Profile
# strip out iBooks citation
sed -E -e 's/^[ ]?[0-9]* //g' | sed -E -e 's/“[ ]?[0-9]?[ ]?//g' | sed -E -e 's/”$//g' | sed -E -e 's/^(Excerpt From).*//g'
.monaco-workbench.no-workspace>.part.statusbar {
background-color: #333333 !important;
}
@immanuelsun
immanuelsun / tab-trigger.js
Created September 27, 2016 18:20 — forked from wesbos/tab-trigger.js
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@immanuelsun
immanuelsun / customizer.php
Created June 15, 2016 00:31
WordPress Customizer: add contact details section
// Add theme customizer controls, settings, etc.
function kingdom_customize_register($wp_customize)
{
/********************************************
! define genric controls
*******************************************/
/**
* create class to define textarea in Customizer
*/
class Kingdom_Customize_Textarea_Control extends WP_Customize_Control
@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' )
));
@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 / .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 / 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
# ---------------------------------------------------------------------------
#
# 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 / wp_carousel.php
Last active August 29, 2015 14:04
A slideshow using Bootstrap carousel in WordPress.