Skip to content

Instantly share code, notes, and snippets.

View sriram15690's full-sized avatar

Sriram R sriram15690

View GitHub Profile
http://busypeoples.github.io/post/react-component-lifecycle/
http://www.undefinednull.com/2015/05/03/react-tdd-example-unit-testing-and-building-a-react-component-with-jest-gulp-and-react-test-utils/
http://www.jackcallister.com/2014/12/01/building-a-test-suite-in-react-js.html
Mocha- React:
http://www.hammerlab.org/2015/02/14/testing-react-web-apps-with-mocha/
def lambda_test(x)
lam = lambda { |x| puts "Square is #{x * x}"; return; puts "cube is #{x*x*x}" }
lam.call x
puts "Hello World in Lambda"
end
def proc_test(x)
proc = Proc.new do |x|
puts "Square is #{x * x}"
return
var User = function (fname, lname) {
this.fname = fname;
this.lname = lname;
this.fullname = function(){
console.log("Fullname is "+this.fname+" "+this.lname);
};
};
var Member = function(memberId, fname, lname) {
@sriram15690
sriram15690 / ldapRuby
Created June 27, 2015 20:24
LDAP with Ruby
#dc - domain component
#cn - common name
#ou - org units
require 'net/ldap'
class Ldap
attr_accessor :ldap_connection, :params, :ldap_response
def initialize(params = {})
self.ldap_connection = connect_to_ldap_server()
function Shape(){
this.name = 'Shape';
this.toString = function () {
return this.name;
};
}
function TwoDShape(){
this.name = '2D shape';
}
function Triangle(side, height){
var User = function (fname, lname) {
this.fname = fname;
this.lname = lname;
this.fullname = function(){
console.log("Fullname is "+this.fname+" "+this.lname);
};
};
var Member = function(memberId, fname, lname) {
var p = new Promise(function (resolve, rejeect) {
$.ajax({
url: "https://api.github.com/users/sriram15690",
type: "GET",
success: function(response){
resolve(response);
},
error: function(response) {
reject(response);
}
Enzyme:
1. Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components' output.
2. Use any assertion library.
3. Shallow rendering - useful for testing components as a unit, and to ensure that your tests aren't indirectly asserting on behavior of child components.
4. methods are similar to jQeury API
@sriram15690
sriram15690 / urls
Last active October 5, 2016 08:37
urls
Testing:
http://code.tutsplus.com/tutorials/testing-your-javascript-with-jasmine--net-21229
http://awaxman11.github.io/blog/2013/08/05/what-is-the-difference-between-a-block/
React:
http://busypeoples.github.io/post/react-component-lifecycle/
jQuery Cheatsheet:
https://oscarotero.com/jquery/
#module DateParser
#DateTime.new(2016,06,06,17,20,10).strftime("%d/%m/%Y %I,'M%p")
require "date"
require 'active_support/all'
EXISTING_PATTERNS = {
months: ['january','february','march','may','june','july','august','september', 'october','november','december'],
days: ['sunday','monday','tuesday', 'wednesday','thursday','friday','saturday'],
past: ["before","ago", 'yesterday', 'last','previous'],