Skip to content

Instantly share code, notes, and snippets.

View yippee-ki-yay's full-sized avatar

Nenad Palinkasevic yippee-ki-yay

View GitHub Profile
contract PolyExample {
struct Proposal {
address token;
uint amount;
address recipient;
uint numApprovedTiers;
bool exists;
}
mapping (uint -> uint) monsterIndexArr;
uint[] monsterList;
// NOTICE: in the uint mapping if nothing is set you get 0
// and that would be the 0 index in the array, so never user 0 index
// that's why I pushed the first element in the array at the begining
monsterList.push(0);
functions add(monsterId) public {
contract BasicAccessControl {
address public owner;
// address[] public moderators;
mapping (address => bool) public moderators;
bool public isMaintaining = false;
function BasicAccessControl() public {
owner = msg.sender;
}
#include <stdio.h>
int main() {
int MAX_ELEMENTS = 25;
int X[MAX_ELEMENTS], A[MAX_ELEMENTS], B[MAX_ELEMENTS];
// trazimo od korinika da unese broj od 1 - 25
printf("Unesite koliko elementa zelite da unesete (maksimalno 20): ");
#include <stdio.h>
int main() {
// praksa je da se ovake konstante stavljaju u promenjivu, gde je kovencija da se ime promenjive pise velikim slovimaa
int MAX_ELEMENTS = 20;
// napravimo niz od 20 elementa, kaze u zadatku realni brojevi to su float
// mogu biti i double ako hoces vecu prezinost
float niz[MAX_ELEMENTS];
0x93cdB0a93Fc36f6a53ED21eCf6305Ab80D06becA
0xf43142d41d92da6B9EbE2CbBd7E661eeee97edB0
@yippee-ki-yay
yippee-ki-yay / custom-event-emitter.js
Created March 6, 2017 20:17
A simple custom event emitter class, for learning purposes
class EventEmitter {
constructor() {
this.events = {};
}
emit(eventName, ...args) {
const callback = this.events[eventName];
if(callback) {
@yippee-ki-yay
yippee-ki-yay / 0_reuse_code.js
Created June 6, 2016 07:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;
namespace SqlLiteTest
{
class Program
{