Skip to content

Instantly share code, notes, and snippets.

View bgorkem's full-sized avatar

Bulent Gorkem bgorkem

View GitHub Profile
@bgorkem
bgorkem / .block
Last active October 17, 2019 17:01
rectangle bar chart intro
license: mit
@bgorkem
bgorkem / key.py
Created November 20, 2018 09:41
Python generate AES-256 base-64 key
python -c 'import base64; import os; print(base64.encodestring(os.urandom(32)))'
@bgorkem
bgorkem / truncate.js
Last active February 22, 2023 14:59
truncation from the middle of the string..
/**
* this function will crop any given text to the size of the given target
* will crop in the middle
**/
function cropMiddle(target, text) {
var input,
inputFontStyle,
ellipsisWidth,
maxWidth,
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.4.min.js"></script>
</head>
<body>
<div id="container"></div>
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.4.min.js"></script>