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 pokemon = { | |
firstname: 'Pika', | |
lastname: 'Chu ', | |
getPokeName: function() { | |
var fullname = this.firstname + ' ' + this.lastname; | |
return fullname; | |
} | |
}; | |
var pokemonName = function(snack, hobby) { |
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
const DAOVotingContract = { | |
balance: 400, | |
id: 3, | |
authorizedVoters: [ | |
{ nodeId: "A", address: "Alice" }, | |
{ nodeId: "B", address: "Eve" }, | |
{ nodeId: "A", address: "Gal Gadot" } | |
], | |
votes: [ | |
{ |
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 groupCopy = _.cloneDeep($scope.group); | |
groupCopy.calendarDates = groupCopy.calendarDates.map(function(calendarDate) { | |
return _.omit(calendarDate,'source'); | |
}) | |
// $http.put('api/groupss/' + $scope.group._id, groupCopy).success(function(data){ | |
// $scope.group = data; | |
// console.log(data); | |
// }); |
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>Omer's Workshop</title> | |
<script src="https://unpkg.com/redux@latest/dist/redux.min.js"></script> | |
</head> | |
<body> | |
<div> | |
<p> | |
Counter: <span id="value">0</span> times |
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 pokemon = { | |
firstname: 'Pika', | |
lastname: 'Chu ', | |
getPokeName: function() { | |
var fullname = this.firstname + ' ' + this.lastname; | |
return fullname; | |
} | |
}; | |
var pokemonName = function() { |
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
function waysToReturnMemoize(amount, denominations) { | |
// intialize an array of zeros with indices up to amount | |
var waysOfDoingNcents = []; | |
for (var i = 0; i <= amount; i++) { | |
waysOfDoingNcents[i] = 0; | |
} | |
// there is 1 way to renturn 0 cents | |
waysOfDoingNcents[0] = 1; | |
for (var j = 0; j < denominations.length; j++) { |
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
// triple the value of every item in a given array | |
const triple = (arr) => arr.map((currentItem) => currentItem * 3) | |
// sum all the elements in a given array | |
const sum = (arr) => arr.reduce((prev, current) => prev + current, 0) |
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
{ | |
"users": [ | |
{ | |
"id": "40", | |
"firstName": "Alex", | |
"age": 13, | |
"companyId": "2" | |
}, | |
{ | |
"id": "41", |
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
const MoveFundsAfterDateContract = { | |
balance: 400, | |
expirationDate: new Date("October 13, 2016 11:13:00"), | |
id: 2, | |
fromAddress: "Bob", | |
call: function() { | |
return { getBalance: this.balance, getFromAddress: this.fromAddress }; | |
}, | |
send: function() { | |
return { changeBalance: this.changeBalance }; |
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
const CounterContract = { | |
balance: 0, | |
counter: 0, | |
incrementValue: function() { | |
this.counter++; | |
}, | |
id: 1, | |
fromAddress: "Alice", | |
call: function() { | |
return { |
NewerOlder