Skip to content

Instantly share code, notes, and snippets.

View how to use sparql client on rdf.rb
#step 1 - installation
sudo gem install sparql
#step 2 - test
# in test.rb
require 'sparql/client'
sparql = SPARQL::Client.new("http://dbpedia.org/sparql")
@Funfun
Funfun / about.md
Created Sep 2, 2011 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
View about.md
@Funfun
Funfun / popup_center_nested_window_html.js
Created Jan 19, 2012
popup centered nested window in html
View popup_center_nested_window_html.js
function popupCenter(url, width, height, name) {
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);
return window.open(url, name, "menubar=no,toolbar=no,status=no,width="+width+",height="+height+",toolbar=no,resizable=yes,scrollbars=yes,left="+left+",top="+top);
};
/* Usage by example */
jQuery('.auth_form').submit(function(e){
var $form = jQuery(this);
View gist:1730897
development:
adapter: postgresql
username: studentify
host: 127.0.0.1
port: 5432
password: smarty_pens
database: studentify_development
test:
adapter: postgresql
@Funfun
Funfun / gist:1761416
Created Feb 7, 2012
Validation failed
View gist:1761416
ActiveRecord::RecordInvalid in SessionsController#new
Validation failed: Photo /tmp/stream20120208-13082-389z2b.txt is not recognized by the 'identify' command., Photo /tmp/stream20120208-13082-389z2b.txt is not recognized by the 'identify' command.
@Funfun
Funfun / index.html
Created Apr 2, 2012
Slider example implementation in SVG
View index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
svg {
background: #333;
}
@Funfun
Funfun / index.html
Created Apr 2, 2012
Slider example implementation in SVG (issue #1)
View index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
svg {
background: #333;
}
@Funfun
Funfun / index.html
Created Apr 3, 2012 — forked from enjalot/index.html
Simple Pie Chart example with D3.js
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
@Funfun
Funfun / data.json
Created Apr 10, 2012
simple force-directed graph using d3
View data.json
{
"nodes": [
{
"name": "Myriel",
"group": 1
},
{
"name": "Napoleon",
"group": 1
},
@Funfun
Funfun / .bash_profile
Created Jun 15, 2012
bash profile (git tips for bash)
View .bash_profile
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# add local bin path
PATH=$HOME/.bin:$PATH
PATH=/usr/local/bin:$PATH
PATH=/usr/local/sbin:$PATH
PATH=/usr/local/mysql/bin:$PATH
# don't put duplicate lines in the history