Skip to content

Instantly share code, notes, and snippets.

View knubbbe's full-sized avatar

Marcus Melvinson knubbbe

  • West Art Communication AB
  • Sweden
View GitHub Profile
@knubbbe
knubbbe / config.js
Created May 18, 2020 18:25
Surfingkeys config
// an example to create a new mapping `ctrl-y`
mapkey('<Ctrl-y>', 'Show me the money', function() {
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
//map('gt', 'T');
// an example to remove mapkey `Ctrl-i`
unmap('<Ctrl-i>');
@knubbbe
knubbbe / cVimrc
Last active February 13, 2020 10:39
cVim settings
let configpath = '/home/knubbe/.cvimrc'
set localconfig " Update settings via a local file (and the `:source` command) rather
" than the default options page in chrome
" As long as localconfig is set in the .cvimrc file. cVim will continue to read
" settings from there
@knubbbe
knubbbe / terminal-commands.md
Last active June 23, 2022 12:33
Terminal commands

Terminal commands

KOLLA IP INFO:

ifconfig # sladd
iwconfig # wifi

SÖK FIL:

@knubbbe
knubbbe / localStorage size checker.js
Last active January 7, 2019 10:02
Add this as a chrome bookmark
javascript: var x, xLen, log=[],total=0;for (x in localStorage){if (typeof localStorage[x] === 'function' || x === 'length') {continue;} xLen = ((localStorage[x].length * 2 + x.length * 2)/1024); log.push(x.substr(0,30) + " = " + xLen.toFixed(2) + " KB"); total+= xLen}; if (total > 1024){log.unshift("Total = " + (total/1024).toFixed(2)+ " MB");}else{log.unshift("Total = " + total.toFixed(2)+ " KB");}; alert(log.join("\n"));
.tooltip-wrapper {
position: absolute;
top: 0;
left: 0;
opacity: 0;
border-radius: 3px;
box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
transition: transform 0s, opacity .2s ease-in-out;
z-index: 99;
<FilesMatch \.php$>
# 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php7.1-fpm.sock|fcgi://localhost/"
# Else we can just use a tcp socket:
#SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
/**
* http://ratiobuddy.com/
*/
%aspect-ratio-box {
position: relative;
overflow: hidden;
&:before {
display: block;
content: '';
@knubbbe
knubbbe / animated-number.component.js
Created May 23, 2017 07:18
Vue animated number component
Vue.component('animated-number', {
name: 'animated-number',
template: '<span :class="[classes]">{{ displayNumber }}</span>',
props: {
number: {
type: Number,
default: 0
},
speed: {
type: Number,
@knubbbe
knubbbe / slack-sidebar-knubbe.txt
Created February 24, 2017 07:51
Slack sidebartheme
#2e3136,#282b30,#282B30,#ffffff,#3a3d42,#a3a3a3,#43b581,#7289da
@knubbbe
knubbbe / webroot
Created February 7, 2017 07:13
adds www-data and sets propriet permissions
#!/bin/bash
sudo adduser $USER www-data
sudo chown -R www-data:www-data /home/$USER/www
sudo chmod -R 775 /home/$USER/www