This file contains hidden or 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
// test code for project exquis -> https://github.com/gongfuio/Exquis | |
// setup | |
this.TO_RADIANS = Math.PI/180; | |
this.buffer = document.createElement('canvas'); | |
this.buffer.width = context.canvas.width; | |
this.buffer.height = context.canvas.height; | |
this.bufferCtx = this.buffer.getContext("2d"); | |
this.rotation = 0; |
This file contains hidden or 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 vanilla import Window, SquareButton, TextEditor | |
import vanilla | |
import mojo | |
def onSubmit(sender): | |
CurrentFont().info.note = window.textEditor.get() | |
window.close() | |
if CurrentFont() is None: | |
vanilla.dialogs.message("there is no current font, operation aborted") |
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
public class Caster : MonoBehaviour { | |
void Update(){ | |
Vector3 rayOrigin = transform.position; // l'origine du rayon: la position du gameobject | |
Vector3 rayDirection = transform.up; // la direction du rayon: l'axe local y positif |
This file contains hidden or 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
p, li, h1, h2, h3, ul { | |
text-align: left; | |
} | |
table.files { | |
font-family: verdana,arial,sans-serif; | |
font-size:18px; | |
color:#333333; | |
border-width: 1px; | |
border-color: #999999; |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
class Proc | |
def self.compose(f, g) | |
lambda { |*args| f[g[*args]] } | |
end | |
def *(g) | |
Proc.compose(self, g) |
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
public class VeryNaivePlane : MonoBehaviour { | |
public float flightSpeed = 20; | |
public float rotationSpeed = 60; | |
void Update () { | |
transform.position += transform.forward * flightSpeed * Time.deltaTime; | |
This file contains hidden or 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 vanilla | |
import mojo | |
from mojo.UI import getDefaultCharacterSet, getCharacterSets | |
def buildDictFromUnicodeToGlyphname(): | |
"HACK: builds a dict from unicode to glyphnames" | |
defaultCharSet = getCharacterSets()[getDefaultCharacterSet()] | |
font = NewFont() | |
result = {} | |
for glyphName in defaultCharSet: |
This file contains hidden or 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
(defmacro print-symbol [expr] | |
`(println | |
(str (name '~expr) | |
" -> " | |
(eval ~expr)))) | |
(defmacro print-map-property [property aMap] | |
`(println | |
(str (name '~property) | |
" -> " |
This file contains hidden or 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
class Node | |
def accept visitor | |
raise NotImplementedError.new | |
end | |
end | |
module Visitable | |
def accept visitor | |
visitor.visit self | |
end |
This file contains hidden or 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
(fn myComp [& fs] | |
(let [ordered-fs (reverse fs)] | |
(fn[& args] | |
(loop [f-list (rest ordered-fs) | |
v (apply (first ordered-fs) args)] | |
(if (not (seq f-list)) v | |
(recur (rest f-list) ((first f-list) v))))))) |