Skip to content

Instantly share code, notes, and snippets.

@janus
janus / para.clj
Created January 26, 2011 11:10
A function that splits sentence\paragraph if it contains [ \* \{ ]
;;Build a function splitParagraph which, given a paragraph string, returns an array of paragraph fragments. ;;Think of a good way to represent the fragments.
;;Clojure version (naive)
(ns moon)
(def map-tag {\{ \} \* \* })
;; the tags use will use for as breaking point....
(def map-type { \* "Footnotes" \{ "References"})
;; what you intend to use as your type
(def map-num { \{ 1 \* 1 })
;; just to make use you started one char above
Index: sapi/cli/config.w32
===================================================================
--- sapi/cli/config.w32 (revision 308839)
+++ sapi/cli/config.w32 (working copy)
@@ -6,7 +6,8 @@
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
@janus
janus / error
Created May 15, 2011 17:19 — forked from tj/error
if foo
if bar
something
else
something_else
else
baz
@janus
janus / gist:1462082
Created December 11, 2011 18:52 — forked from jamescasbon/template.py
Pure python templates using with statement
"""
A really stupid python template language inspired by coffeekup, markaby.
Do not use this code, it will ruin your day. A byproduct of insomnia.
TL;DR
-----
This module defines a template language that allows us to do:
d = Doc()
@janus
janus / flat.js
Created February 21, 2017 07:24
JavaScript function that flattens array of any permutation
/**
* This is 'gentle' way of traversing an array
* and flatten it if it has multiple arrays.
* We chose not to use function reduce becuase
* we want ours to be intuitive.
*/
function flat(arr) {
@janus
janus / gist:2a381026d1c07d98bb8aa4228495cde1
Created January 25, 2018 07:53 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@janus
janus / mathProxy.js
Last active May 24, 2018 08:38
Helping kids to play with Math
// This is just a sample script. Paste your real code (javascript or HTML) here.
/*
* Copy right holder Ikjo
* You are free to enjoy, however give credit to Ikjo
* examples
* mathProxy.twofourMultiplyonePlusfivefiveDividethree()
* mathProxy.two_four_Multiply_one_Plus_five_five_Divide_three()
* conditions
* math operators are titlized
* number are lower case
@janus
janus / route.js
Created May 25, 2018 18:28
Skeleton for Server Router
function Route() {
this.routeMatch = new RouterMatch();
}
Route.prototype.execReg = function(url) {
let re = new RegExp(this.regs);
let myArray = re.exec(url);
return myArray;
@janus
janus / rt.js
Created June 5, 2018 19:41
JavaScript Path Route
function Route() {
this.routeMatch = new RouterMatch();
this.indexPaddingStatic = 0;
this.indexPaddingDynamic = 0;
}
Route.prototype.dispatch = function(url) {
let routeCaptures = this.routeMatch.captureGroup;
@janus
janus / FSharp
Last active February 23, 2019 07:40
Get Address Type
open Nethereum
open System
open System.Threading
open Nethereum.Web3