Skip to content

Instantly share code, notes, and snippets.

View gudnm's full-sized avatar

Ivan Vashchenko gudnm

View GitHub Profile
#include <iostream>
using namespace std;
int main() {
int count = 0, foo = 0, i = 0, j = 0, m = 0, n = 0;
const int LEN = 10;
int a[LEN][LEN];
int b[LEN][LEN];
for (i = 0; i < LEN; i++) {
for (j = 0; j < LEN; j++) {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gudnm
gudnm / objectsEqual.js
Created June 26, 2017 15:53
JavaScript function for checking if two objects are equal by value
var objectsEqual = (a, b) => {
const aProps = Object.getOwnPropertyNames(a),
bProps = Object.getOwnPropertyNames(b);
if (aProps.length != bProps.length) {
return false;
}
for (var i=0; i<aProps.length; i++) {
const propName = aProps[i];
@gudnm
gudnm / cube.py
Created June 30, 2017 00:29
The dumbest solution for eraser cube puzzle
from itertools import permutations
pieces = [[0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0],
[0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1],
[1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1],
[0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0],
[0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1]]
def rotations(piece):
@gudnm
gudnm / pomodoro.html
Last active April 8, 2018 02:27
Simple pomodoro timer (written in vanilla JS)
<div>
<div id="history">
<ul id="completed_tasks">
</ul>
</div>
<div id="working">
Working on <span id="current_task">current task</span>, <span id="task_countdown">25:00</span> left.
</div>
<div id="break">
Completed <span id="finished_task">a task</span>. On break, <span id="break_countdown">5:00</span> left.