Skip to content

Instantly share code, notes, and snippets.

View voter101's full-sized avatar

Wiktor Mociun voter101

View GitHub Profile
@voter101
voter101 / 1.asm
Created May 5, 2014 09:43
Mips exercise 1
jal printResult
j main
nextState:
add $t7, $zero, $ra
addi $t6, $zero, 0
addi $t4, $zero, 31
nextStateLoop:
jal countNeighbours
jal checkBit
@voter101
voter101 / 2.asm
Created May 5, 2014 09:44
Mips exercise 2
li $v0, 7
syscall
mov.d $f6, $f0 # f6 = a
li $v0, 7
syscall
mov.d $f8, $f0 # f8 = e
# setting f2 = x0
# f2 = x_(n-1)
addi $s0, $zero, 2
@voter101
voter101 / 3.asm
Created May 5, 2014 09:44
Mips exercise 3
main:
addi $t7, $zero, 128
li $v0, 13
la $a0, filename
li $a1, 0
li $a2, 0
syscall
addi $s0, $v0, 0
readFromFile:
@voter101
voter101 / 5.asm
Created May 5, 2014 18:32
Mips exercise 5 (using Digital Sim Lab in Mars)
addi $t3, $zero, 4294901776 #right display
addi $t4, $zero, 4294901777 #left display
newGame:
li $v0, 42
li $a1, 255
syscall
move $t7, $a0
addi $t6, $zero, 0
addi $t5, $zero, 7
loop:
Our file structure per single mini-application:
app_starter.js.coffee
--- app_directory
--- app.module.js.coffee
--- backend.module.js.coffee
--- components
--- component_file1.module.js.coffee
...
--- domain.module.js.coffee
--- glue.module.js.coffee
@voter101
voter101 / Gulpfile.js
Last active November 29, 2021 01:17
Gulpfile for Rails application with replaced Sprockets with Gulp
'use strict'
var gulp, sass, babelify, browserify, watchify, source, util;
gulp = require('gulp');
sass = require('gulp-sass');
babelify = require('babelify')
browserify = require('browserify');
watchify = require('watchify');
source = require('vinyl-source-stream');
let rec prefixes l = match l with
[] -> []
| x::xs -> [x] :: (List.map (fun a -> (x :: a)) (prefixes xs));;
@voter101
voter101 / flatten.js
Created August 3, 2016 18:35
Flattening nested arrays in JavaScript
// Let me present my steps in finding the right solution. If you are not interested in seeing the process,
// please skip to `flatten2` function.
// You can copy-paste the code into your browser - it will run both versions against tests and return output
// First approach, a bit naive, split to 2 functions. Let's do it dirty, but working.
//
// The idea is to use the fact of JavaScript's property of pass-by-reference arguments in function
// This solution is in O(n).
function flatten1(arr) {

Keybase proof

I hereby claim:

  • I am voter101 on github.
  • I am voter101 (https://keybase.io/voter101) on keybase.
  • I have a public key ASA_SMNo8S0qbdNsYE8k999BOB1Vu_cwA2PkQ6QKpv0b5wo

To claim this, I am signing this object:

@voter101
voter101 / codechallenge2.md
Created September 28, 2021 16:10 — forked from rui-localyze/codechallenge2.md
Code Challenge v2.0

Localyze

Coding challenge

This is our coding challenge, aimed at getting to know you and your code skills a bit better. There's no time limit on the challenge, but we expect you to invest just a couple of hours of your day. Most of all, we hope you have fun working on this, show off your skills!

What is expected of you?

Choose at least one of the following challenges and using Ruby or Javascript send us the solution to the challenge, ideally hosted on Github or Gitlab.