Skip to content

Instantly share code, notes, and snippets.

View deepakjois's full-sized avatar
🎯
Focusing

Deepak Jois deepakjois

🎯
Focusing
View GitHub Profile
@deepakjois
deepakjois / facebook_embed.html
Created June 5, 2013 12:59
Soundcloud Facebook OpenGraph Embed
<meta content="soundcloud:sound" property="og:type" />
<meta content="http://soundcloud.com/oliver-hookins/space-hideout" property="og:url" /><meta content="Space Hideout" property="og:title" />
<meta content="http://i1.sndcdn.com/artworks-000037505804-vy2r3t-t500x500.jpg?86be403" property="og:image" />
<meta content="My latest composition, which I put together over the last week.Let me know what you think... I hope you enjoy it!" property="og:description" /><meta content="19507961798" property="fb:app_id" />
<meta content="soundcloud" property="twitter:site" /><meta content="SoundCloud" property="og:site_name" />
<meta content="video" name="medium" /><meta content="98" property="og:video:height" />
<meta content="460" property="og:video:width" /><meta content="application/x-shockwave-flash" property="og:video:type" />
<meta content="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F73515637&amp;color=3b5998&amp;auto_play=true&amp;show_artwork=false&amp;origin=facebook" pr
@deepakjois
deepakjois / build_error.txt
Created June 3, 2013 16:46
Error in diagrams-svg build
$ cabal-dev build
Building diagrams-svg-0.6.1...
Preprocessing library diagrams-svg-0.6.1...
[1 of 3] Compiling Graphics.Rendering.SVG ( src/Graphics/Rendering/SVG.hs, dist/build/Graphics/Rendering/SVG.o )
src/Graphics/Rendering/SVG.hs:228:20:
Not in scope: `colorToSRGBA'
Perhaps you meant `colorToRGBA' (imported from Diagrams.Prelude)
src/Graphics/Rendering/SVG.hs:232:20:
Not in scope: `colorToSRGBA'
// ciphertext is a []byte
cipherhex := make([]string, len(ciphertext))
for i, v := range ciphertext {
cipherhex[i] = fmt.Sprintf("%02x", v)
}
return strings.Join(cipherhex,"")
import os
from peopleflow import app
import unittest
import tempfile
from os import environ
(hasgeek_env) $ python runserver.py
Traceback (most recent call last):
File "runserver.py", line 2, in <module>
from peopleflow import app
File "/Users/deepak/code/work/hasgeek/peopleflow/peopleflow/__init__.py", line 9, in <module>
from flaskext.assets import Environment, Bundle
ImportError: No module named assets
@deepakjois
deepakjois / y.rb
Created May 13, 2012 17:11
Y Combinator in Ruby, Take 2
# Y Combinator in Ruby, Take 2
#
# Based off an explanation of Y Combinator here:
# http://article.gmane.org/gmane.comp.lang.perl.perl-mongers.boston/1518
#
# Also inspired by this post from nex3:
# http://nex-3.com/posts/43-fun-with-the-y-combinator-in-ruby
# Here's an explanation of the Y-Combinator. It won't work in
# Perl because Perl doesn't do lexical binding of input
src/Graphics/BarChart/Rendering.hs:75:14:
Could not deduce (Renderable Diagrams.TwoD.Text.Text b0)
arising from a use of `text'
from the context (Measurable a, Show a)
bound by the type signature for
drawBarChart :: (Measurable a, Show a) =>
Config -> BarChart a -> Diagram SVG R2
at src/Graphics/BarChart/Rendering.hs:(72,1)-(76,76)
Possible fix:
add (Renderable Diagrams.TwoD.Text.Text b0) to the context of
@deepakjois
deepakjois / example.hs
Created April 28, 2012 22:32
Diagrams SVG Backend Text Rendering
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
eff = text "F" <> square 1 # lw 0
example = eff # rotateBy (1/7)
main = defaultMain example
@deepakjois
deepakjois / blaze-html.md
Created March 31, 2012 03:43
Comparing blaze-markup and blaze-html benchmarks

blaze-html

./benchmarks/RunHtmlBenchmarks --resamples 10000 -u results.csv
warming up
estimating clock resolution...
mean is 2.045215 us (320001 iterations)
found 22885 outliers among 319999 samples (7.2%)
  13018 (4.1%) low severe
  9867 (3.1%) high severe
@deepakjois
deepakjois / svg_combinators.lhs
Created February 26, 2012 18:20
Ideas for an SVG combinator library
An HTML document constructed using blaze-html looks like this
> page1 :: Html
> page1 = html $ do
> head $ do
> title "Introduction page."
> link ! rel "stylesheet" ! type_ "text/css" ! href "screen.css"
> body $ do
> div ! id "header" $ "Syntax"
> p "This is an example of BlazeHtml syntax."