Skip to content

Instantly share code, notes, and snippets.

View nagaozen's full-sized avatar

Fabio Zendhi Nagao nagaozen

View GitHub Profile
@nagaozen
nagaozen / flatten.js
Created July 5, 2019 14:43
Production ready implementation of flatten
function flatten(array) {
// environment checks
if (typeof Array.forEach !== "function")
throw "Environment doesn't support `Array.forEach`. You must update the environment or use a polyfill.";
if (typeof Array.isArray !== "function")
throw "Environment doesn't support `Array.isArray`. You must update the environment or use a polyfill.";
// validate input
if (!Array.isArray(array))
throw "Argument MUST be an array";
// short circuit edge cases
@nagaozen
nagaozen / Vagrantfile
Created March 10, 2016 15:08 — forked from tvjames/Vagrantfile
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
<parser
id="asp_section"
displayName="Visual Basic (.NET|Script|for Applications)"
commentExpr="(?m:((?&lt;=&apos;).*?$)|((?i:REM)([\t ].*?)?$))"
>
<classRange
mainExpr="(?s:(?&lt;SCOPE&gt;(?i:CLASS|TYPE)).*?(?i:END[\t ]\k&lt;SCOPE&gt;))"
displayMode="node"
>
<className>
@nagaozen
nagaozen / new_gist_file
Created June 24, 2013 19:54
Selects into Unordered List
var c = document.getElementById("details_texts_selects")
, ss = c.getElementsByTagName("select")
, i, len
;
for(i = 0, len = ss.length; i < len; i++) procSelect(ss[i]);
function procSelect(s) {
var p = s.parentNode
, ul = document.createElement("ul")
@nagaozen
nagaozen / factorial.xslt
Created June 4, 2012 14:13
XSLT templates as functions (factorial example)
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<!-- x := 5 -->
<xsl:variable name="x" select="5"/>
<!-- y := factorial(x) -->
<xsl:variable name="y">
@nagaozen
nagaozen / entityModel.asp
Created March 13, 2012 17:47
Evolved Open Schema Entity Framework
<%
' Class: EntityModel
'
' Evolved entities are hybrid EAV and BLOB open schema trees. This class models
' the Entity itself, a tree of EntityModel_Nodes.
'
' Dependencies:
'
' - base.asp
@nagaozen
nagaozen / ctags.cnf
Created February 23, 2011 14:02
This was supposed to be the perfect ctags javascript extension. Unfortunately gnu_regex seems to not support Zero-width negative lookahead, anyone can help?!
--langdef=js
--langmap=js:.js
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*true/\1/b,boolean/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*false/\1/b,boolean/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*new[ \t]+Boolean[ \t]*\(/\1/b,boolean/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*[0-9.]+/\1/n,number/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*new[ \t]+Number[ \t]*\(/\1/n,number/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*["']/\1/s,string/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*new[ \t]+String[ \t]*\(/\1/s,string/
--regex-js=/["']?([A-Za-z_$][A-Za-z0-9._$]*)["']?[ \t]*[:=][ \t]*\[/\1/a,array/
<job>
<reference object="ADODB.Stream" />
<object id="stmANSI" progId="ADODB.Stream" />
<object id="stmUTF8" progId="ADODB.Stream" />
<script language="VBScript">
Option Explicit
With stmANSI
.Open
.LoadFromFile "ANSI.txt"
/* +-----------------------------------------------------------------------------+
* |This file is part of ASP Xtreme Evolution. |
* |Copyright © 2007, 2009 Fabio Zendhi Nagao |
* | |
* |ASP Xtreme Evolution is free software: you can redistribute it and/or modify |
* |it under the terms of the GNU Lesser General Public License as published by |
* |the Free Software Foundation, either version 3 of the License, or |
* |(at your option) any later version. |
* | |
* |ASP Xtreme Evolution is distributed in the hope that it will be useful, |