Skip to content

Instantly share code, notes, and snippets.

View zdfs's full-sized avatar
😡
THANKS. I HATE IT.

Zachary Forrest y Salazar zdfs

😡
THANKS. I HATE IT.
View GitHub Profile
@ryanmcgrath
ryanmcgrath / JapaneseRegex.js
Created May 20, 2011 02:32 — forked from sym3tri/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@adactio
adactio / monthform.html
Created December 13, 2011 22:20
An experiment with a progressive enhancement pattern to replace two select with a single year-month field.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Input test</title>
</head>
<body>
<form method="post" action="#">
@vmus
vmus / hankaku.js
Created July 27, 2012 14:48
Japanese text normalization (fullwidth to halfwidth)
// Japanese text normalization (fullwidth to halfwidth)
function normalize(s) {
function zentohan(c) {
var z2h = {
'ガ':'ガ','ギ':'ギ','グ':'グ','ゲ':'ゲ','ゴ':'ゴ',
'ザ':'ザ','ジ':'ジ','ズ':'ズ','ゼ':'ゼ','ゾ':'ゾ',
'ダ':'ダ','ヂ':'ヂ','ヅ':'ヅ','デ':'デ','ド':'ド',
'バ':'バ','パ':'パ','ビ':'ビ','ピ':'ピ','ブ':'ブ',
'プ':'プ','ベ':'ベ','ペ':'ペ','ボ':'ボ','ポ':'ポ','ヴ':'ヴ',
'ァ':'ァ','ア':'ア','ィ':'ィ','イ':'イ','ゥ':'ゥ','ウ':'ウ','ェ':'ェ','エ':'エ','ォ':'ォ','オ':'オ',
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@evanlarsen
evanlarsen / transitionHelper.js
Last active February 8, 2021 17:12
Durandal transition helper file. This imposes that you are using https://github.com/daneden/animate.css Also, that you have changed the animation duration in animate.css from 1s to .3s
define(function(require) {
var system = require('../system');
var animationTypes = [
'bounce',
'bounceIn',
'bounceInDown',
'bounceInLeft',
'bounceInRight',
'bounceInUp',
@Mike-Dunton
Mike-Dunton / Collatz.js
Last active August 9, 2016 21:49
Collatz conjecture in js
// Return Collatz sequence in an array.
// Linear Vs Tail Recursion in Javascript
// http://jsperf.com/collatz-conjecture-linear-vs-tail
//===================================================================================================================
function collatzTail(n, accumulator){
if(n === 1) {
accumulator.push(1);
return accumulator;
} else if(isEven(n)) {
accumulator.push(n);
@tkissing
tkissing / gist:0a642811a783ad0e09be
Created January 7, 2015 18:14
$.Deferred vs new Promise vs Callbacks - be careful you are not rebuilding the hell
// consider the following code
function getInfoDef() {
var result = {something: 'static'};
var def = $.Deferred();
$.ajax('/some-url').then(function(data) {
result.also = data.dynamic;
def.resolve(result);
}).fail(def.reject.bind(def));