This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello React</title> | |
<script src="https://fb.me/react-with-addons-0.13.2.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.2.js"></script> | |
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> | |
<style> | |
.example-enter { | |
opacity: 0.01; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#use `` to execute shell commands | |
#use expr shell command to do math | |
echo "add 4 and 5" | |
a=4 | |
b=5 | |
echo `expr $a + $b` | |
#Suppose you have file called 'hotel.txt' with 100 lines data, And from 'hotel.txt' | |
#you would like to print contains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"bytes" | |
) | |
func AddOneToEachElement(slice []int) { | |
for i := range slice { | |
slice[i]++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func GetAllSubsets(arr []int64, size int) [][]int64{ | |
if len(arr) == size { | |
result := [][]int64{arr} | |
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func Join(arr []int64, str string) string { | |
result := "" | |
last_index := len(arr) - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDone: boolean = false; | |
//As in JavaScript, all numbers in TypeScript are floating point values. | |
var height: number = 6; | |
console.log('isDone: ', isDone); | |
console.log('height: ', height) | |
var name: string = "bob"; | |
name = 'smith'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
var constantString = "Hi" | |
var str: String? = "Hello, playground" | |
//str = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FrankensteinHash is a subclass of Hash | |
# It lets you create many levels of keys in Hash at one go. | |
class FrankensteinHash < Hash | |
def [](key) | |
fetch(key) {|el| self[el] = FrankensteinHash.new} | |
end | |
end | |
h = FrankensteinHash.new | |
h["a"]["b"]["c"] = 1 #=> 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get the sample rails app | |
# git clone https://github.com/vikashvikram/neo4jrails.git | |
# in case you are using neo4j with rails app, run follwoing commands to setup | |
rake neo4j:install[community-latest] | |
# to start a neo4j server from rails app | |
rake neo4j:start[development] | |
# start neo4j shell from a rails app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#user nobody; | |
worker_processes 8; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
OlderNewer