Skip to content

Instantly share code, notes, and snippets.

View baxang's full-sized avatar

Sanghyun Park baxang

  • Jora
  • Sydney, Australia
View GitHub Profile
$view = new view;
$view->name = 'advocacy_db';
$view->description = 'Advocacy Database';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
@baxang
baxang / unicode-key-symbols.rb
Created August 3, 2012 10:29
This script produces a comma separated list of special key symbols in Unicode for WP-Table Reloaded.
#!/usr/bin/env ruby
# coding: utf-8
# Raw data : http://unicode.org/Public/UNIDATA/UnicodeData.txt
# Format : http://www.ksu.ru/eng/departments/ktk/test/perl/lib/unicode/UCDFF301.html
require 'csv'
require 'htmlentities'
options = {
@baxang
baxang / cp.bat
Created August 14, 2012 18:46
A Windows batch file that conveniently uninstalls known malware. From the original post http://goo.gl/NrhST
"%APPDATA%\RapidGet\RPGUnist.exe"
"%PROGRAMFILES%\1410002\unins000.exe"
"%PROGRAMFILES%\365boan\uninst_365boan.exe"
"%PROGRAMFILES%\4shared.com\UNWISE.exe"
"%PROGRAMFILES%\4shared Desktop\uninstall.exe"
"%PROGRAMFILES%\동키호테\uninstall.exe"
"%PROGRAMFILES%\디팝매니저V3\unins000.exe"
"%PROGRAMFILES%\사이트 바로가기\uninst.exe"
"%PROGRAMFILES%\스마트튠\uninst.exe"
"%PROGRAMFILES%\11STshoppingIcon\uninstall.exe"
@baxang
baxang / gist:4165837
Created November 29, 2012 00:29
Canceling current animation when the mouse pointer hovers on/out quickly.
$('#i-am-an .box').hover(
function(e) {
var t = $(this).find('.drawer');
if (t.is(':animated')) {
t.stop(true, false);
}
t.delay(100).animate({top:'0px'}, 400);
},
function(e) {
var t = $(this).find('.drawer');
server {
listen 80;
server_name fast-track.asia www.fast-track.asia fta.seeitworks.asia;
rewrite ^ http://blog.fast-track.asia$request_uri? permanent;
}
require 'nokogiri'
require 'addressable/uri'
api_key = 'your_key'
uri = Addressable::URI.parse 'http://openapi.epost.go.kr/postal/retrieveLotNumberAdressService/retrieveLotNumberAdressService/getComplexList'
uri.query_values = {
ServiceKey: api_key,
srchwrd: '무악동',
areaNm: '현대아파트',
# A formtastic input which incorporates carrierwave uploader functionality.
#
# Intelligently adds the cache field, displays and links to the current
# value if there is one, adds a class to the wrapper when replacing an
# existing value, allows removing an existing value with the checkbox
# taking into account validation requirements.
#
# There are several options:
#
# * Toggle the replacement field with `replaceable: true/false`.
$ bundle exec compass watch --trace
>>> Change detected at 12:01:38 to: active_admin.css.scss
error app/assets/stylesheets/active_admin.css.scss (Line 13: File to import not found or unreadable: active_admin/mixins.
Load paths:
/Users/shpark/Projects/projectc/app/assets/stylesheets
/Users/shpark/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/Users/shpark/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter)
identical public/stylesheets/active_admin.css
NoMethodError on line ["32"] of /Users/shpark/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sass-rails-3.2.3/lib/sass/rails/helpers.rb: undefined method `[]' for nil:NilClass
@baxang
baxang / bootstrap-grid-tn.css.scss
Created March 26, 2014 02:21
Add an additional breakpoint which covers 0..479px to Twitter Bootstrap 3.1.
// Add a breakpoint which covers 0..479px
$screen-tn: 320px !default;
$screen-tn-min: $screen-tn !default;
$screen-tn-max: ($screen-xs-min - 1) !default;
// Additional grid mixins for tn.
@mixin make-tn-column($columns, $gutter: $grid-gutter-width) {
@baxang
baxang / rails-remote-form-keep-disabled.js
Created October 24, 2014 11:32
Override Rails' jQuery-ujs default form disable behaviour: Keep the form disabled after a successful submission.
(function($, undefined) {
var $document = $(document);
$document.undelegate($.rails.formSubmitSelector, 'ajax:complete.rails');
$document.delegate($.rails.formSubmitSelector, 'ajax:error.rails', function(event) {
if (this == event.target) $.rails.enableFormElements($(this));
});
})(jQuery);