Skip to content

Instantly share code, notes, and snippets.

View nake89's full-sized avatar
😊
Have a great day!

Kevin Kivi nake89

😊
Have a great day!
View GitHub Profile
@nake89
nake89 / 0_reuse_code.js
Created December 23, 2016 19:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nake89
nake89 / new.py
Created February 19, 2018 14:16
searchinfile python function
def searchinfile(srchstr, filename):
with open(filename) as f:
wasd = 0
for line in f:
#print(line.lower(), end='')
tolwr = line.lower()
if srchstr in tolwr:
#print("found test in: " + line)
wasd += 1
@nake89
nake89 / wikifocus.user.js
Created June 5, 2018 11:52
Wikipedia search focus
// ==UserScript==
// @name Wikipedia search focus
// @namespace http://tampermonkey.net/
// @version 0.1
// @description focus focus focus
// @author nake89
// @match https://en.wikipedia.org/*
// @grant none
// ==/UserScript==
@nake89
nake89 / mulda.js
Created September 20, 2018 15:51
Create multidimensional array in javascript
class Mulda {
constructor(a, b) {
var mulda = new Array(a)
for (var x = 0; x < a; x++) {
mulda[x] = new Array(b)
}
return mulda
}
}
@nake89
nake89 / Caddyfile
Created December 8, 2018 15:15
caddy
localhost
on startup php-cgi -b 10000 &
fastcgi / 127.0.0.1:10000 php
root .
errors stderr
class Canvas {
constructor(x, y) {
this.x = x
this.y = y
this.canvas = document.createElement("canvas")
this.ctx = this.canvas.getContext("2d")
document.body.appendChild(this.canvas)
this.ctx.fillStyle = "rgb(51, 51, 51)"
this.ctx.fillRect(0, 0, x, y)
{"creation_date": { $exists: true }}
@nake89
nake89 / i3-gaps.sh
Created March 23, 2019 08:59 — forked from dabroder/i3-gaps.sh
Install i3-gaps on ubuntu 18.04
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake i3status suckless-tools
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install
let body = req.body
let url = req.url
let original_url = req.originalUrl
let method = req.method
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hello</title>
</head>