Skip to content

Instantly share code, notes, and snippets.

@volkanozcan2
volkanozcan2 / rnd_pixel.go
Created Oct 16, 2020
faker go library usage sample.
View rnd_pixel.go
package main
import (
"fmt"
"github.com/bxcodec/faker"
)
type pixel struct {
R, G, B uint8
View okul_için
function foo(x, y) {
this.x = x;
this.y = y;
this.color = "#" + ((1 << 24) * Math.random() | 0).toString(16)
this.move = function() {
this.x += cos(random(360))
this.y += sin(random(360))
}
this.çiz = function() {
ellipse(this.x, this.y, 20, 20)
@volkanozcan2
volkanozcan2 / .eslintrc.json
Last active Aug 14, 2019
npm i -g eslint eslint-plugin-react
View .eslintrc.json
{
"env": {
"browser": true,
"es6": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
@volkanozcan2
volkanozcan2 / readable.js
Last active Aug 10, 2019
node:readable stream
View readable.js
const { Readable } = require("stream");
const { firstName, lastName } = require("faker/locale/en").name;
const { createWriteStream } = require("fs");
class randomName extends Readable {
constructor(options) {
super(options);
this.count = 1e3;
}
_read() {
View Express 4 and Socket.io: Passing socket.io to routes - app.js
var app = express();
app.io = require('socket.io')();
var routes = require('./routes/index')(app.io);
app.use('/', routes);
@volkanozcan2
volkanozcan2 / arraybuffer.js
Created Jul 3, 2019
arraybuffer to base64 for images etc..
View arraybuffer.js
'data:image/jpeg;base64,' + btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)
@volkanozcan2
volkanozcan2 / coin_toss.py
Created Apr 15, 2019
lambda function for coin count.
View coin_toss.py
import numpy as np
coin_toss=lambda n=1:n if np.random.rand()<0.5 else coin_toss(n+1)
View Welcome file.md

demo

import math
import numpy as np
from scipy import constants as cons

$$\large t_{' }=\frac{t^{}}{\sqrt{1-\frac{V^2}{c^2}}}$$

@volkanozcan2
volkanozcan2 / index.html
Created Aug 23, 2018
to ivan.popelyshev
View index.html
<div id="myContainer"></div>
@volkanozcan2
volkanozcan2 / index.html
Created Aug 21, 2018
to ivan.popelyshev
View index.html
<div id="myContainer"></div>
You can’t perform that action at this time.