Skip to content

Instantly share code, notes, and snippets.

#ifdef GL_ES
precision mediump float;
#endif
#extension GL_EXT_gpu_shader4 : enable
uniform sampler2D u_texture;
uniform vec2 g_Resolution;
varying vec2 v_texCoords;
@scan
scan / crop.js
Created November 6, 2013 07:14 — forked from arian/crop.js
var spawn = require('child_process').spawn;
var Stream = require('stream');
/**
* crops and resizes images to our desired size
* @param {Stream} streamIn in stream containing the raw image
* @return {Stream}
*/
exports.cropImage = function(streamIn){
@scan
scan / KV.hs
Last active December 20, 2015 07:49 — forked from LeviSchuck/KV.hs
{-# LANGUAGE RecordWildCards, MultiParamTypeClasses, FlexibleInstances #-}
class KVEntity a b where
kvIdentity :: a -> KVIdentifier
kvProperties :: a -> Value
kvLastModified :: a -> UTCTime
kvClass :: a -> KVClass
kvRelations :: a -> [KVLink]
kvCachedRels :: a -> [b]
import Data.List (isSuffixOf)
dropSuffix s str | s `isSuffixOf` str = take ((length str) - (length s)) str
| otherwise = str
toUnderscore (a:b:c) | isAlpha a, isUpper b = a : '_' : toUnderscore (toLower b : c)
toUnderscore (a:b) = a : toUnderscore b
toUnderscore x = x
@scan
scan / OAuth2.hs
Created July 13, 2013 15:19 — forked from qzchenwl/OAuth2.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
@scan
scan / OAuth2.hs
Created July 10, 2013 07:05 — forked from qzchenwl/OAuth2.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
$ ->
($ '#login-btn').click ->
navigator.id.request
siteName: 'neighr'
#siteLogo: '/logo.png'
false
($ '#logout-btn').click ->
navigator.id.logout()
false
class GoogleAnalytics
@init: (webPropertyId) ->
@_initQueue(webPropertyId)
scriptTag = @_createScriptTag()
@_injectScriptTag(scriptTag)
@_initQueue: (webPropertyId) ->
window._gaq ?= []
window._gaq.push ['_setAccount', webPropertyId]
window._gaq.push ['_trackPageview']
@scan
scan / http.hs
Last active December 18, 2015 15:18
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module Main where
--import Data.Conduit.Binary
import Network.Wai
import Network.Wai.Handler.Warp
import Network.HTTP.Types
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Char8 as B
import Control.Monad.Trans