Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
/** | |
* Template Name: Assets | |
*/ | |
$js_dir = dirname( __FILE__ ) . '/assets/js/'; | |
$css_dir = dirname( __FILE__ ) . '/assets/css/'; | |
$js = $js_dir . '*.js'; | |
$css = $css_dir . '*.css'; | |
$register = array(); | |
$enqueue = array(); |
<?php | |
function load_template( $_template_file, $require_once = true ) { | |
global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; | |
if ( is_array( $wp_query->query_vars ) ) { | |
extract( $wp_query->query_vars, EXTR_SKIP ); | |
} | |
if ( isset( $s ) ) { | |
$s = esc_attr( $s ); |
{ | |
"remove-empty-rulesets": true, | |
"always-semicolon": true, | |
"color-case": "lower", | |
"block-indent": " ", | |
"color-shorthand": true, | |
"element-case": "lower", | |
"eof-newline": true, | |
"leading-zero": false, | |
"quotes": "double", |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
function matrixDiagDiff(m) { | |
var d1 = d2 = 0; | |
for(var i = 0, l = m.length; i < l; i++){ | |
d1 += m[i][i]; | |
d2 += m[i][l-(i+1)]; | |
} | |
console.log(d1-d2); | |
} |
function matrixPlusDiff(m) { | |
var d1 = d2 = 0; | |
for(var i = 0, l = m.length; i < l; i++){ | |
d1 += m[i][Math.floor(l/2)]; | |
d2 += m[Math.floor(l/2)][i]; | |
} | |
console.log(d1-d2); | |
} |
#!/bin/bash | |
hostName=$1 | |
echo "$hostName creation procedure starts" | |
# create directory at /var/www/ | |
sudo mkdir /var/www/$hostName | |
# goto apache dirctory | |
cd /etc/apache2/sites-available |
// case insensetive | |
function countLetterFrequency(str) { | |
var a = str.toLowerCase().split('').sort(), | |
o = {}, | |
char = []; | |
while(a.length) { | |
char = a.slice(0, a.lastIndexOf( a[0] ) + 1 ); | |
o[char[0]] = char.length; | |
a = a.slice( a.lastIndexOf( a[0] ) + 1 ); |
(function ($) { | |
"use strict"; | |
/*global wp,jQuery */ | |
var CustomGalleryEdit,CustomFrame; | |
function customClasses() { | |
var media = wp.media; | |
var l10n = media.view.l10n; | |
/*jslint undef: false, browser: true, devel: false, eqeqeq: false, bitwise: false, white: false, plusplus: false, regexp: false, nomen: false */ | |
/*global wp,jQuery */ | |
jQuery(document).ready(function($) { | |
if (!window.wp || !window.wp.media) { | |
return; | |
} | |
var media = window.wp.media; |