View fib_proc.py
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
from time import time | |
def fib(x): | |
if x in (0, 1): | |
return x | |
fib1 = 0 | |
fib2 = 1 | |
current = 1 |
View .vimrc
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
# Taken from http://www.alexeyshmalko.com/2014/using-vim-as-c-cpp-ide/ | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set noexpandtab | |
augroup project | |
autocmd! | |
autocmd BufRead,BufNewFile *.h,*.c set filetype=c.doxygen |
View email.regex.js
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 emailRe = /^([\w\d\-+](\.?[\w\d_\-+])*)@(((2([0-4]\d|5[0-5])|1?\d{1,2})\.){3}(2([0-4]\d|5[0-5])|1?\d{1,2})|[a-z\d]([a-z\d-]{1,61}[a-z\d])?(?:\.[a-z]{2,})+)$/ | |
// Able to pass the test samples here: https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/ |
View functools.js
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 reduce(transform, append, arr, init) { | |
const l = arr.length | |
let i = 0 | |
let accum = init | |
if (typeof accum === 'undefined') { | |
accum = arr[0] | |
i = 1 | |
} | |
for (; i < l; i++) { | |
accum = append(accum, transform(arr[i])) |
View ImbaAdapter.js
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
import Vue from 'vue' | |
import { Component, Prop } from 'vue-property-decorator' | |
import Imba from 'imba' | |
/** | |
import { App } from './App.imba' | |
import ImbaAdapter from './ImbaAdapter' | |
View .block
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
license: mit |
View jsx-dom.js
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 h = (tag, attrs, ...children) => { | |
const elm = document.createElement(tag) | |
for (let key in attrs) { | |
if (key.slice(0, 2) == 'on') { | |
const evtName = key.slice(2) | |
const cb = attrs[key] | |
if (cb == null) continue // we can use null or undefnied to suppress | |
elm.addEventListener(evtName, cb) | |
} else if (['disabled', 'autocomplete', 'selected', 'checked'].indexOf(key) > -1) { | |
if (attrs[key]) { |
View webpack.config.ts
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
/** | |
* (c) 2017 Hajime Yamasaki Vukelic | |
* Some rights reserved. | |
* | |
* yarn add -D webpack webpack-dev-server ts-node ts-loader html-webpack-plugin @types/webpack @types/html-webpack-plugin | |
*/ | |
import path = require("path"); | |
import HTMLWebpackPlugin = require("html-webpack-plugin"); |
View jsx.d.ts
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
// I'm not the original author of this code. Please let me | |
// know if you know/find the original author so I can fully | |
// attribute. | |
import Vue, { VNode } from "vue"; | |
declare global { | |
namespace JSX { | |
interface Element extends VNode {} | |
interface ElementClass extends Vue {} |
View fib.erl
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
-module(fib). | |
-export([fib/1, tests/0]). | |
fibOf(0) -> | |
0; | |
fibOf(1) -> | |
1; | |
fibOf(N) -> | |
fibOf(N-1) + fibOf(N-2). |
NewerOlder