Skip to content

Instantly share code, notes, and snippets.

View kucukkanat's full-sized avatar
⌨️
Working on santa.ai

HT kucukkanat

⌨️
Working on santa.ai
View GitHub Profile
@kucukkanat
kucukkanat / bip39.js
Created May 28, 2022 03:09
BIP39 implementation from scratch for browsers
/**
BIP39 Implementation from scratch for browsers
Documentation: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
*/
;(async()=>{
const wordlist = ["abandon", "ability", "able", "about", "above", "absent", "absorb", "abstract", "absurd", "abuse", "access", "accident", "account", "accuse", "achieve", "acid", "acoustic", "acquire", "across", "act", "action", "actor", "actress", "actual", "adapt", "add", "addict", "address", "adjust", "admit", "adult", "advance", "advice", "aerobic", "affair", "afford", "afraid", "again", "age", "agent", "agree", "ahead", "aim", "air", "airport", "aisle", "alarm", "album", "alcohol", "alert", "alien", "all", "alley", "allow", "almost", "alone", "alpha", "already", "also", "alter", "always", "amateur", "amazing", "among", "amount", "amused", "analyst", "anchor", "ancient", "anger", "angle", "angry", "animal", "ankle", "announce", "annual", "another", "answer", "antenna", "antique", "anxiety", "any", "apart", "apology", "appear", "apple", "
@kucukkanat
kucukkanat / gdown
Created October 10, 2021 16:00
Large file downloader from google drive
#!/usr/bin/env sh
export fileid=$1
export filename=$2
TEMP_CONFIRM_FILE=confirm.txt
TEMP_COOKIE_FILE=TEMP_COOKIE_FILE
## WGET ##
wget --save-cookies TEMP_COOKIE_FILE 'https://docs.google.com/uc?export=download&id='$fileid -O- \
| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1/p' > ${TEMP_CONFIRM_FILE}
@kucukkanat
kucukkanat / gist:2ffe1f04893168789e46f541fd5c954a
Last active November 21, 2020 20:06
glasscockpitbeta.json
{
"isEnabled": true,
"duration": 5
}
@kucukkanat
kucukkanat / webpack.config.js
Created June 12, 2020 22:36
Webpack config for react libraries
// yarn add webpack webpack-cli typescript ts-loader mini-css-extract-plugin sass sass-loader style-loader css-loader
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
devtool: "source-map", // any "source-map"-like devtool is possible
entry: path.resolve(__dirname, "src/index.tsx"),
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
@kucukkanat
kucukkanat / keybase.md
Created April 12, 2019 22:23
Keybase proof

Keybase proof

I hereby claim:

  • I am kucukkanat on github.
  • I am kucukkanat (https://keybase.io/kucukkanat) on keybase.
  • I have a public key ASCm1o-xgZsrJZ_AbJZPuVb56E-XfAsyL8sOJttWQ2_69go

To claim this, I am signing this object:

@kucukkanat
kucukkanat / promise.js
Created January 16, 2018 08:38
Manual implementation of Promise
function Promise(fn) {
var callback = null;
this.then = function(cb) {
callback = cb;
};
function resolve(value) {
// force callback to be called in the next
// iteration of the event loop, giving
// callback a chance to be set by then()
@kucukkanat
kucukkanat / _utils.scss
Last active January 16, 2018 08:39
My utility CSS classes
.no {
&-padding {
padding: 0;
}
&-margin {
margin: 0
}
&-padding-top {
padding-top: 0
}
@kucukkanat
kucukkanat / redux.light.js
Last active May 30, 2018 13:13
A rewrite of redux
var _ = require('lodash');
var globalStore;
function getInstance(){
if (!globalStore) globalStore = createStore();
return globalStore;
}
@kucukkanat
kucukkanat / distance.js
Last active January 27, 2018 22:21
Distance Finder
var getDistance = function(lat1,lon1,lat2,lon2){
var R = 6371; // km
//has a problem with the .toRad() method below.
var dLat = toRad(lat2-lat1);
var dLon = toRad(lon2-lon1);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
-- Turkce isimler sozlugu twitter : http://twitter.com/tserpico
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------