By Default 'jekyll serve' makes jekyll accessible on 127.0.0.1 (localhost).
To make it accessible by outsiders, use --host 0.0.0.0 with it.
jekyll serve --host 0.0.0.0
/*Insert collection returns promise*/ | |
var insertCollection = function(collectionName,doc){ | |
var collection = db.get(collectionName); | |
return collection.insert(doc); | |
} | |
/* using the function which returns promise */ | |
insertCollection('collection_name',{'key':'value'}) | |
.success(function(){ |
var Promise = require('bluebird'); | |
var monk = require('monk'); | |
var db = //your db connection; | |
/*Inserting multiple doc is possible collection.col.insert | |
But it will not return promise, so returning our own promise*/ | |
var insertMultiple = function(collectionName, docArray){ | |
return new Promise(function(resolve,reject){ |
Dependencies | |
sudo apt-get install ruby ruby-dev make gcc nodejs | |
Jekyll Installation: | |
sudo gem install jekyll --no-rdoc --no-ri | |
If jekyll installation fails use the below command to install. |
1. Create a file CNAME on the gh-pages Branch. | |
2. Type your domain name and save the CNAME file. eg. dppages.com | |
3. Goto you domain settings on domain registered site (godaddy, bigrock, etc.,). | |
4. Add the IPs below on the 'A' record. | |
192.30.252.153 | |
192.30.252.154 |
By Default 'jekyll serve' makes jekyll accessible on 127.0.0.1 (localhost).
To make it accessible by outsiders, use --host 0.0.0.0 with it.
jekyll serve --host 0.0.0.0
/* This will return size of document object in bytes */ | |
Object.bsonsize(<document>); |
.shadow-div{ | |
-moz-box-shadow:5px 5px 7px rgba(33,33,33,1); | |
/* Safari+Chrome */ | |
-webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7); | |
/* Opera */ | |
box-shadow: 5px 5px 7px rgba(33,33,33,.7); | |
} |
#gem install httparty | |
require 'httparty' | |
url = 'http://httpbin.org/user-agent' | |
response = HTTParty.get(url) | |
p response.parsed_response |
require 'active_record' | |
ActiveRecord::Base.establish_connection ({ | |
:adapter => "mysql2", | |
:host => "localhost", | |
:username => "root", | |
:password => "", | |
:database => ""}) | |
class TableName < ActiveRecord::Base |
require 'active_support/core_ext/hash/conversions' | |
def xml_to_hash filename | |
doc = Nokogiri::XML.parse(File.open(filename)) | |
Hash.from_xml(doc.to_s) | |
end | |
p xml_to_hash 'file/to/path/filename.xml' |