Skip to content

Instantly share code, notes, and snippets.

View TomaszWaszczyk's full-sized avatar
🔑
Between cyber, number puzzles, war and Bible.

Tomasz Waszczyk TomaszWaszczyk

🔑
Between cyber, number puzzles, war and Bible.
View GitHub Profile
package com.waszczyk.interviewsample;
public class ArrayReverse {
public static void main(String[] args) {
int myarray[] = {1,2,3};
reverseArray(myarray);
}
@TomaszWaszczyk
TomaszWaszczyk / gist:a09aa44e7a30d58f94d5
Created September 25, 2014 06:28
static class in java
package com.waszczyk.staticlass;
public class A {
public class B {
int a;
int b;
}
}
@TomaszWaszczyk
TomaszWaszczyk / gist:a92e0caab9ee86b7e646
Last active August 29, 2015 14:07
Multiple JSONs from String to POJO ? ?
Hej,
mam pytanie odnośnie kodu:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.apache.http.HttpEntity;
//+------------------------------------------------------------------+
//| operatoryArytmetyczne.mq4 |
//| Tomasz Waszczyk |
//| https://www.waszczyk.com |
//+------------------------------------------------------------------+
#property copyright "Tomasz Waszczyk"
#property link "https://www.waszczyk.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
var socketTest = $websocket('ws://localhost:8080/echo');
socketTest.onOpen(function(evt) {
$log.info('WEBSOCKET map-alerts CONNECTED');
$log.info(evt);
});
socketTest.onMessage(function(message){
$log.info('WEBSOCKET map-alerts');
$log.info(message);
0x02983D36b6B2175D378b7D950d6BD935c496Ed7E
@TomaszWaszczyk
TomaszWaszczyk / Eyeballing-This.md
Created February 12, 2019 08:12 — forked from zcaceres/Eyeballing-This.md
Understanding Binding and 'this' in Javascript

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

To understand this, we need to see where it is invoked. Nothing else matters, with one exception which we'll cover in a moment.

@TomaszWaszczyk
TomaszWaszczyk / enzyme_render_diffs.md
Created August 6, 2019 15:30 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

var express = require('express')
, app = express.createServer();
app.get('/', function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.configure(function () {