Skip to content

Instantly share code, notes, and snippets.

@buroz
buroz / auth.html
Last active December 25, 2018 10:54
Flask Cookie Auth
<!DOCTYPE html>
<html lang="tr">
<body>
<form action="auth" method="POST">
<input name="username" type="text" />
<input name="password" type="password" />
<input type="submit" />
</form>
</body>
</html>
@buroz
buroz / _grid.scss
Last active March 19, 2019 10:01
SCSS Grid System Named "GATES"
/*
CROSS BROWSER GRID SYSTEM by Burak OZ
Usege:
<div id="grid" class="cell-12 cell-1200-6 cell-992-3 cell-768-3 cell-480-2">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
import sharp from 'sharp'
import { createWriteStream } from 'fs'
let wstream = createWriteStream('resized.jpg');
sharp('muscle.jpg')
.rotate()
.resize(200)
.toBuffer()
.then( data => { wstream.write(data) })
const { MongoClient } = require('mongodb');
(async (url) => {
const connection = await MongoClient.connect(url, {
poolSize: 10,
reconnectTries: Number.MAX_VALUE,
reconnectInterval: 1000,
useNewUrlParser: true
})
@buroz
buroz / tiny-cookie.js
Created July 10, 2019 11:58
Tiny Cookie String Parser for Node
@buroz
buroz / index.html
Created July 15, 2019 07:03
template engine
<h1><strong style="color:red">Reponse Port : </strong>8003</h1>
<p><strong style="color:red">METHOD: </strong>{{method}}</p>
<p><strong style="color:red">URL: </strong>{{url}}</p>
<p><strong style="color:red">Req HTTP Version: </strong>{{version}}</p>
@buroz
buroz / index.html
Last active July 15, 2019 07:15
template engine
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
html {
margin: 0;
padding: 0;
@buroz
buroz / area.js
Created July 29, 2019 10:16
Routelike first tries
let area = [];
for (let i = 0; i < 6; i++) {
area[i] = new Array(6);
}
for (let j = 0; j < 6; j++) {
for (let l = 0; l < 6; l++) {
area[j][l] = "@";
}
const { Readable } = require("stream");
const { promisify } = require("util");
const express = require("express");
const mongodb = require("mongodb");
const multer = require("multer");
const ObjectID = require("mongodb").ObjectID;
const app = express();
"use strict";
const os = require("os");
const delaySeconds = 1;
const decimals = 3;
(function loop() {
console.log("CPU load is " + cpuLoad());
setTimeout(loop, delaySeconds * 1000);
})();