Skip to content

Instantly share code, notes, and snippets.

View wisniewski94's full-sized avatar
๐Ÿ‡

Wiktor wisniewski94

๐Ÿ‡
View GitHub Profile
em++ ../main.cpp ../stringFormat.cpp \
-Os -g1 \
-s WASM=1 \
-s MALLOC=emmalloc \
-s ALLOW_MEMORY_GROWTH=1 \
-s EXPORT_ES6=1 \
-s MODULARIZE=1 \
-s 'EXPORT_NAME="LongerSubSequence"' \
-s 'ENVIRONMENT="web"' \
--bind \
@wisniewski94
wisniewski94 / css-supports.js
Created January 27, 2020 11:48 — forked from codler/css-supports.js
CSS.supports() Polyfill
/*! CSS.supports() Polyfill
* https://gist.github.com/codler/03a0995195aa2859465f
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
if (!('CSS' in window)) {
window.CSS = {};
}
if (!('supports' in window.CSS)) {
window.CSS._cacheSupports = {};
window.CSS.supports = function(propertyName, value) {
@wisniewski94
wisniewski94 / es6-import-cheat-sheet.md
Created November 28, 2019 14:00 — forked from samueljseay/es6-import-cheat-sheet.md
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}

Closures

Domkniฤ™cie wystฤ™puje wtedy gdy funkcja moลผe zapamiฤ™taฤ‡ oraz uzyskaฤ‡ dostฤ™p do swojego zakresu leksykalnego nawet po jej wykonaniu na zewnฤ…trz tego zakresu:

function  hello(name)  {
	//ta zmienna nie zostanie zapamiฤ™tana poniewaลผ
	// nie jest uลผywana przez zwracanฤ… funkcjฤ™
	let zmienna = "zmienna";
import http from "./httpService";
import _ from "lodash";
class Weather {
constructor(location, dayTime) {
if (_.isString(location) == false || _.isString(dayTime) == false) {
throw new Error("Invalid parameters");
}
//https://medium.com/@gajus/my-favorite-css-hack-a7f447026cf2
//"The problem is that unless the element on the page has a solid background or it is a picture,
// you do not see how does it fit into the layout, e.g. most of the text nodes, pictures with
//transparency, etc."
*
background-color: rgba(255, 0, 0, 0.2)
outline: 1px solid blue
*
background-color: rgba(0, 255, 0, 0.2)
# DOCKER
docker build # Builds Docker images from a Dockerfile
docker run -it <container id> bash # Run bash inside docker container
# CONTAINERS
docker ps -a # List running containers
docker container ls -a # List containers
docker restart <container> # Restart container
docker stop $(docker ps -aq) # Stop all containers
docker rm $(docker ps -a -q) # Remove all containers
@wisniewski94
wisniewski94 / generateTree.js
Created July 3, 2019 23:21
N-ary Tree Generator
class Node {
constructor(parent, id) {
this.id = id;
this.child = [];
this.parent = parent;
}
setChild(child) {
this.child.push(child);
}
@wisniewski94
wisniewski94 / Win10-64bit-npm.md
Created May 21, 2019 12:56 — forked from jtrefry/Win10-64bit-npm.md
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
<html>
<head><title>Canvas Delaunay Triangulation</title></head>
<body></body>
<script type="text/javascript">
var img = new Image();
img.onload = init;
img.src = './bg_10.jpg';
var display, source;
var points = [], drew = [];