This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @icetee - https://gist.github.com/icetee/b399a9a464c19e5f93071318edbceebf | MIT */ | |
$.fn.serializeNormObject = function() { | |
var o = {}, | |
self = this, | |
elems = self.find('input, textarea, select, .serialize').not('[type="submit"], [data-disabled]'); | |
$.each(elems, function() { | |
var $this = $(this), | |
_type = $this.prop('type'), | |
_val = $this.attr('data-value') || $this.val() || ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -i ./.wgetrc -m -o ./.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/a/462093 | |
function getParameters() { | |
var parameters = new Object(); | |
var parts = window.location.search.substring(1).split('&'); | |
for (var parti = parts.length; parti-- > 0; ) { | |
var subparts = parts[parti].split(';'); // support semicolon separators as well as ampersand (see HTML 4.01 section B.2.2) | |
for (var subparti = subparts.length; subparti-- > 0; ) { | |
var parparts = subparts[subparti].split('=', 2); | |
if (parparts.length == 2) | |
parameters[decodeURIComponent(parparts[0])] = decodeURIComponent(parparts[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once dirname(__FILE__) . '/../conf.php'; | |
define('EXP_FILENAME', 'example_export.csv'); | |
define('EXP_FILENAME_LOCAL', 'sqlexort.csv'); | |
function getFiled($fields) { | |
return $fields["orgname"]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceKeys(array $input) { | |
$return = array(); | |
foreach ($input as $key => $value) { | |
if (strpos($key, '@') === 0) | |
$key = substr($key, 1); | |
if (is_array($value)) | |
$value = replaceKeys($value); | |
$return[$key] = $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Navigation selector, class name | |
(function stickyHeader($nav, cn){ | |
var sticky = function() { | |
return ($nav.hasClass(cn)) ? true : false; | |
}; | |
$(window).scroll(function (event) { | |
var scroll = $(window).scrollTop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('getTaxonomyToGrid')) { | |
function getTaxonomyToGrid($postID, $taxonomy, $args_opt = array(), $grid_part = 3) { | |
$query = new WP_Query(array( | |
'P' => $postID | |
)); | |
$grid = $active = array(); | |
if ( $query->have_posts() ) { | |
$args = array( | |
'taxonomy' => $taxonomy, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'), | |
path = require('path'); | |
const walk = (dir, done) => { | |
let results = []; | |
fs.readdir(dir, (err, list) => { | |
if (err) return done(err); | |
let i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# macOS | |
find . -maxdepth 5 -iname ".ftpconfig" | zip DEV.zip -@ | |
# Windows 10 | |
Get-ChildItem -Recurse -Depth 5 -Filter ".ftpconfig" -Path . | % { $_.FullName } | zip DEV.zip -@ |