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
### | |
A teapot with an orbiting directional light source that you can rotate with the mouse. | |
The white dot is not the actual position of the light - it just indicates its direction | |
relative to the teapot. | |
Lindsay S. Kay, (CoffeeScript port by Rehno Lindeque) | |
[email protected] | |
### |
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
SceneJS.createScene({ | |
type: 'scene', | |
id: 'Scene', | |
canvasId: 'scenejsCanvas', | |
loggingElementId: 'scenejsLog', | |
flags: | |
{ | |
backfaces: false, | |
}, | |
nodes: [ |
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
SceneJS.createScene({ | |
type: 'scene', | |
id: 'Scene', | |
canvasId: 'scenejsCanvas', | |
loggingElementId: 'scenejsLog', | |
flags: | |
{ | |
backfaces: false, | |
}, | |
nodes: [ |
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
SceneJS.createScene({ | |
type: 'scene', | |
id: 'Scene', | |
canvasId: 'scenejsCanvas', | |
loggingElementId: 'scenejsLog', | |
flags: | |
{ | |
backfaces: false, | |
}, | |
nodes: [ |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
-- | |
-- Copied from Yesod | |
-- see http://www.yesodweb.com/ | |
-- | |
module Reload (main, develLoop) where | |
-- reload | |
import Control.Concurrent (forkIO, threadDelay) | |
import qualified Control.Exception as Ex |
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
# Script to switch a Huawei Modem from Mass Storage to Modem in Ubuntu using usb_modeswitch | |
# (after inserting usb, run repeatedly until device is switched to modem. | |
# If you wait too long device wont switch and you need to remove it, | |
# reconnect the usb device and run script again) | |
# Btw. If you stumble on this while looking for a solution to your Huawei modem problems... There may be better ways: | |
# https://help.ubuntu.com/community/DialupModemHowto/Huawei | |
# http://askubuntu.com/questions/179324/huawei-e173-on-ubuntu-12-04 | |
# http://ubuntuforums.org/showthread.php?t=1605484 |
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.exports = _ = require "lodash" | |
# Define the function you want to test | |
# (This is a lodash extension: Structured map over an object using a corresponding dictionary of functions) | |
_.mixin mapStruct: (obj, fns, defaultFn) -> | |
defaultFn = defaultFn ? if _.isFunction fns then fns else _.identity | |
_.zipObject (for k,v of obj then [k, (fns?[k] ? defaultFn) v, k]) | |
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
-- Shorthand map over List-like | |
f <$ lx = map f lx -- <$> in Haskell | |
lx $> f = map f lx | |
infixr 2 <$ | |
infixr 2 $> | |
-- Shorthand sequential application | |
lf <$$ lx = zipWith (\f x -> f x) lf lx -- <*> in Haskell | |
lx $$> lf = zipWith (\f x -> f x) lf lx -- <**> in Haskell | |
infixr 1 <$$ |
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
:set -i.:config:dist/build/autogen | |
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable | |
import Prelude | |
import Control.Applicative | |
import Data.Char | |
import Data.List | |
import qualified Data.Text as T | |
import Data.Text (Text) |
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
// Not mine, politely stolen from http://pastebin.com/cwY9jz7T | |
// screen-capture-ubuntu.c | |
// gcc screen-capture-ubuntu.c -o screen-capture-ubuntu `pkg-config --libs --cflags gtk+-2.0` | |
// http://www.bravegnu.org/gtktext/x498.html | |
// http://www.cs.dartmouth.edu/~campbell/cs50/project/gtk.html | |
// http://stackoverflow.com/questions/3124229/taking-a-screenshot-with-c-gtk | |
// http://stackoverflow.com/questions/11963561/screen-capture-in-haskell?lq=1 | |
// http://askubuntu.com/questions/5847/how-to-resolve-gdk-pixbuf-gdk-pixbuf-h-no-such-file-or-directory | |
// https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-The-GdkPixbuf-Structure.html |
OlderNewer