Skip to content

Instantly share code, notes, and snippets.

View sodik82's full-sized avatar

Stanislav Miklik sodik82

  • Slovakia
View GitHub Profile
package sk.sodik.perf;
public class BitVsDiv {
public static void main(String[] args) {
long start1 = System.nanoTime();
int result1 = divide(1000000);
long duration1 = System.nanoTime() - start1;
long start2 = System.nanoTime();
int result2 = bit(1000000);
@sodik82
sodik82 / start-stop-example.sh
Last active February 27, 2016 22:48 — forked from alobato/start-stop-example.sh
start-stop-example
#!/bin/sh
set -e
. /lib/lsb/init-functions
# Must be a valid filename
NAME=tesco
PIDFILE=/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/var/lib/jenkins/.nvm/versions/node/v4.2.4/bin/node
DAEMON_OPTS="server.js"
@sodik82
sodik82 / reactive2016_lightning_talk.md
Created August 31, 2016 17:16
Lightning talk proposal for the Reactive 2016 Conference

This is a proposal for a ⚡lightning talk at the Reactive 2016 conference.

🌟Star this gist if you want to see it on the conference.

Theming of React Native components

Have you started with your RN application and now it is the time to make it beautiful with nice colors? Although you defined your components and you can add colors there, you want different colors in different situations (those inverse headers are so nice 💕))

What if you could simply replace original RN components and styles would be added automatically.

@sodik82
sodik82 / flatten.test.js
Created February 22, 2018 13:07
Flattens nested arrays of numbers
/**
Flattens nested arrays of numbers
@param input (nested) array
@return deeply flattened array
*/
function flatten(input) {
function recursive(arr) {
if (Array.isArray(arr)) {
return arr.reduce((r, v) => r.concat(recursive(v)), [])