Skip to content

Instantly share code, notes, and snippets.

*************LEGEND****************
* *
* {} => params *
* [] => optional *
* () => description *
* == => alternative way *
* *** => quick *
* *
***********************************
create .gitignore file on root.
@riverspirit
riverspirit / build_couchdb.sh
Last active August 29, 2015 14:10
Build CouchBB with GeoCouch from source on Ubuntu/Debian
#!/bin/bash
set -e
git clone git://github.com/jhs/build-couchdb.git
cd build-couchdb
git submodule init
git submodule update
echo '@setfilename autoconf.info' > dependencies/autoconf-2.69/doc/autoconf.texi
echo '@setfilename automake.info' > dependencies/automake-1.11.2/doc/automake.texi
( cd dependencies/autoconf-archive; ed cfg.mk <<< $'g/@diff/d\nw'; git commit -a -m 'fix build' )
git commit -a -m 'fix build'
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting
article like yours. {It's|It is} pretty worth enough
for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers
made good content as you did, the {internet|net|web} will be {much more|a
lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting.
{Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find}
your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service.
@riverspirit
riverspirit / mindbody.js
Created July 1, 2014 12:23
Connect to MindBody API using Node.js
// mindbody.js
// Replace source_name, password and site_id values in `var params`
var soap = require('soap');
module.exports = {
getClasses: function (req, res) {
var url = "https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl";
soap.createClient(url, function (err, client) {
if (err) {
@riverspirit
riverspirit / script.js
Created June 13, 2014 06:00
Load javascript file dynamically and call a function from it
(function (d, f, a) {
// Your settings here
var o = {
maxLinks: 4,
searchElements: ['div', 'h'],
linkClass: 'link-to-mdn',
extraLinks: {
'keywordx': 'http://example.com'
}
};
@riverspirit
riverspirit / Regex to validate URL
Created November 28, 2013 13:25
Regex to validate URL
return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f
@riverspirit
riverspirit / parse_json_get_parent_of_value.js
Created August 20, 2013 04:24
From nested JSON data, get the parent node when a 'value' (not key) is provided.
var jsondata = {
'name': {
'fname': 'Jack',
'lname': [
{'familyName': 'Sparrow'},
{'surname': 'Captain'},
{'tags':[
{'test': 'mocha'},
'program',
{'level': 'five',}
@riverspirit
riverspirit / parse_json.js
Last active December 21, 2015 06:59
Parse nested json data and retrieve value of the given key.
var jsondata = {
'name': {
'fname': 'Jack',
'lname': [
{'familyName': 'Sparrow'},
{'surname': 'Captain'},
{'tags':[
{'test': 'mocha'},
'program',
{'level': 'five',}
@riverspirit
riverspirit / theme.html
Last active December 17, 2015 23:48 — forked from debloper/theme.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>{Title} - Mozilla India</title>
<!-- Base theme "Clarus" by Benjamin Nathan <[email protected]> -->