Skip to content

Instantly share code, notes, and snippets.

View ChangJoo-Park's full-sized avatar
:octocat:
🌱

ChangJoo Park(박창주) ChangJoo-Park

:octocat:
🌱
View GitHub Profile
@ChangJoo-Park
ChangJoo-Park / function.php
Created August 6, 2013 06:46
Wordpress has search function, this function's result is page and post, etc. I need only posts, So add this function in the "function.php" Just Copy & Paste
/* only search post */
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
@ChangJoo-Park
ChangJoo-Park / .htaccess
Last active April 12, 2017 15:58
htaccess for wordpress multisite 3.6
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
@ChangJoo-Park
ChangJoo-Park / pcaptest.c
Created August 16, 2013 08:29
Test libcap library
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if( dev == NULL)
{
fprintf(stderr,"Could Not find default device : %s\n",errbuf);
@ChangJoo-Park
ChangJoo-Park / gist:6290803
Created August 21, 2013 06:01
mobile chrome debug
adb forward tcp:9222 localabstract:chrome_devtools_remote
<?php
class Widget_Name extends WP_Widget {
function Widget_Name() {
$widget_opts = array(
'classname' => 'your-awesome-class',
'description' => 'Your awesome Description',
);
<?php
/*
Template Name: All posts
*/
?>
<?php
$debut = 0; //The first article to be displayed
?>
<?php while(have_posts()) : the_post(); ?>
<h2><?php the_title(); ?></h2>
@ChangJoo-Park
ChangJoo-Park / Preferences.sublime-settings
Last active December 22, 2015 14:38
sublimetext2 preference
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
@ChangJoo-Park
ChangJoo-Park / gist:6762377
Created September 30, 2013 11:18
rails 4 with bootstrap 3
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails'
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@ChangJoo-Park
ChangJoo-Park / FIle.sublime-settings.json
Last active December 26, 2015 14:19 — forked from etrepat/FIle.sublime-settings.json
Sublime Text 3 user settings with space gray theme
{
"auto_complete": false,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",