Skip to content

Instantly share code, notes, and snippets.

View Arieg419's full-sized avatar

Omer Goldberg Arieg419

View GitHub Profile
var pokemon = {
firstname: 'Pika',
lastname: 'Chu ',
getPokeName: function() {
var fullname = this.firstname + ' ' + this.lastname;
return fullname;
}
};
var pokemonName = function(snack, hobby) {
const DAOVotingContract = {
balance: 400,
id: 3,
authorizedVoters: [
{ nodeId: "A", address: "Alice" },
{ nodeId: "B", address: "Eve" },
{ nodeId: "A", address: "Gal Gadot" }
],
votes: [
{
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);
// });
<!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
var pokemon = {
firstname: 'Pika',
lastname: 'Chu ',
getPokeName: function() {
var fullname = this.firstname + ' ' + this.lastname;
return fullname;
}
};
var pokemonName = function() {
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++) {
// 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)
{
"users": [
{
"id": "40",
"firstName": "Alex",
"age": 13,
"companyId": "2"
},
{
"id": "41",
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 };
const CounterContract = {
balance: 0,
counter: 0,
incrementValue: function() {
this.counter++;
},
id: 1,
fromAddress: "Alice",
call: function() {
return {