Skip to content

Instantly share code, notes, and snippets.

View wisniewski94's full-sized avatar
🏇

Wiktor wisniewski94

🏇
View GitHub Profile
<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 = [];
@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
//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)
import http from "./httpService";
import _ from "lodash";
class Weather {
constructor(location, dayTime) {
if (_.isString(location) == false || _.isString(dayTime) == false) {
throw new Error("Invalid parameters");
}

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";
@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 () {}
# 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 / 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) {
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 \
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}