Skip to content

Instantly share code, notes, and snippets.

View Bizunow's full-sized avatar

Ilya Bizunov Bizunow

  • Russia, Krasnodar
View GitHub Profile
@Bizunow
Bizunow / webpack.config.js
Created August 22, 2017 14:33
[Webpack many etry points] #js #webpack
const path = require('path');
module.exports = {
entry: {
index: './src/index.js',
background: './bck/background.js'
},
output: {
path: path.resolve('build'),
filename: '[name].bundle.js'
@Bizunow
Bizunow / module.js
Created August 22, 2017 13:50
[ES6 module example] #js
export const CONST_EXAMPLE = 0;
class ClassName {
static method() {
return 'Hello';
}
}
export default ClassName;
@Bizunow
Bizunow / point-distance.cs
Last active August 24, 2017 07:25
[Point distance] Get distance between tow points #csharp #gamedev
public double getPointDistance(int x1, int y1, int x2, int y2)
{
return Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2);
}
@Bizunow
Bizunow / index.html
Last active August 21, 2017 13:49
[React webpack example] #js #react #webpack
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<title>React App</title>
</head>
@Bizunow
Bizunow / conditional_rendering.js
Created August 21, 2017 08:29
[React conditional rendering] #js #react
render() {
return (
<div className="container">
{this.props.description !== undefined && this.props.description !== '' &&
<div className="description">
{this.props.description}
</div>
}
</div>
);
@Bizunow
Bizunow / react-chartgs-2-line-chart.js
Last active August 22, 2017 11:46
[React ChartJS example] Simple line chart #js #react #react-chartjs-2 #chart
import React, { Component } from 'react';
import { Line } from 'react-chartjs-2';
import './App.css';
class App extends Component {
...
render() {
const data = {
@Bizunow
Bizunow / server_call.js
Last active September 14, 2017 15:47
[Server call] Class for create server-requests, based on fetch #js
// Server.call('GET', 'getVkData', { id: -145636 })
// Server.call('POST', 'postVkData', { id: -145636 })
const MAIN_API_PATH = "http://dune.com/bar/";
class Server {
static call(httpMethod, apiMethod, params = {}) {
let fetchParams = {
headers: { "Content-Type": "application/json" },
mode: "cors",
@Bizunow
Bizunow / change_ttl.sh
Created August 18, 2017 16:39
[TTL Change] Change TTL on Mac #mac #script
#!/bin/sh
sudo sysctl -w net.inet.ip.ttl=65
@Bizunow
Bizunow / react-class.js
Last active August 20, 2017 08:29
[React class template] Simple react class #react #js
import React, { Component } from 'react';
class ObjectName extends Component {
render() {
return (
<div className="ObjectName">
Hello, World!
</div>
);
}