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
perspectiveToFrustum( fov, aspectRatio, near, far ) { | |
tangent = tan( fov/2 * PI / 180 ) | |
height = near * tangent | |
width = height * aspectRatio | |
frustum( (left = -width), (right = width), (bottom = -height), (top = height), near, far ) | |
} |
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
/** | |
* Make a new font face. | |
*/ | |
.makeFontStyle( @name, @uri, @weight, @style ) { | |
font-family: @name; | |
src: url( '@{uri}.eot' ); | |
src: url( '@{uri}.ttf' ) format( 'truetype' ); | |
font-weight: @weight; | |
font-style: @style; | |
} |
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
/** | |
* Load fonts from google fonts CDN. | |
* @param $fonts {Array} Array of fonts to be loaded. | |
* @param $echo {Boolean} If true, print each <link>, else, return an array | |
* @return {Array} If $echo is true, it will return an empty string. | |
* @example loadFontFromGoogle( array( | |
* "Open Sans" => "300,400,600" // font name => thickness | |
* )); | |
*/ | |
function loadFontFromGoogle( $fonts, $echo = true ) { |
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
-- Usage | |
-- setupCallback <* exampleSCBfn | |
newtype Callback a = Callback (a -> IO ()) | |
type SetupAppCallback = IO () | |
infixr 2 <* | |
(<*) :: Callback a -> SetupAppCallback -> IO () |
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
// | |
// Delete this when available. | |
// | |
var Robot=function(r){r.clone();},RP=Robot.prototype; | |
RP.onIdle=function(e){e.robot.ahead();e.robot.rotateCannon(1);} | |
RP.onScannedRobot=function(e){e.robot.fire();} | |
RP.onRobotCollision= | |
RP.onWallCollision=function(e){e.robot.turn(-90+Math.random()*e.bearing);} |
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
// | |
// Turin.js 2.0.7b | |
// @author Bruno Dias | |
// | |
// Damn...events should never block!! | |
// TODO: a lot... | |
var clone; | |
var Robot = function(robot) { | |
this.targetAquired = false; | |
this.targetX = 0; |
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
emptyStr :: BL8.ByteString | |
emptyStr = BL8.pack "" | |
splitAtMatches :: Regex -> BL8.ByteString -> [BL8.ByteString] -> IO [BL8.ByteString] | |
splitAtMatches rexp str buf = do | |
if str == empty then return buf -- if str is empty, we have reached | |
-- the end or no matches. | |
else execute rexp str >>= | |
either (\ (a, b) -> return buf) -- ^ WrapError = (ReturnCode, String)? | |
(\ a -> case a of -- ^ Array Int (indexOf, length) |
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
// node | |
> var a; | |
undefined | |
> 1 + a; | |
NaN | |
> |
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
(defun js/anonymous-function () | |
(interactive) | |
(insert "() => {}")) | |
(defun js/function () | |
(interactive) | |
(insert "function() {}")) |
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
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(default ((t (:inherit nil :stipple nil :background "blue" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 140 :width normal :foundry "nil" :family "Menlo")))) | |
'(custom-comment-tag ((t (:foreground "gray80")))) | |
'(flx-highlight-face ((t (:inherit nil :underline t :weight bold)))) | |
'(font-lock-builtin-face ((t (:foreground "white")))) | |
'(font-lock-comment-face ((t nil))) |
OlderNewer