Skip to content

Instantly share code, notes, and snippets.

View AnderssonPeter's full-sized avatar
🕊️

Peter AnderssonPeter

🕊️
View GitHub Profile
@AnderssonPeter
AnderssonPeter / .p10k.zsh
Created October 5, 2022 09:59
powerlevel10k settings
# Generated by Powerlevel10k configuration wizard on 2022-10-04 at 21:46 CEST.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 21094.
# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode,
# slanted separators, slanted heads, slanted tails, 1 line, sparse, many icons, concise,
# transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#
@AnderssonPeter
AnderssonPeter / linux.sh
Created February 5, 2020 21:52
setting up fish on WSL
apt-get update
apt-get install git curl fish
curl -L https://get.oh-my.fish | fish
usermod -s /usr/bin/fish peter
omf install agnoster
omf theme agnoster
@AnderssonPeter
AnderssonPeter / You shall not debug
Last active August 6, 2019 09:10
Javascript jokes
const fadeText = function () {
function getRandomColor () {
return '#'+Math.floor(Math.random()*16777215).toString(16);
}
const words = 'You shall not debug I am a servant of the JavaScript wielder of the flame of V8. You cannot Debug. The dark fire will not avail you flame of Google. Go back to the IE! You cannot pass.'.split(' ');
var div = document.createElement('div');
div.setAttribute('style', 'position: fixed; right: 10px; bottom: 10px;z-index: 100000; font-size: 100px; font-weight: bold;');
document.body.appendChild(div);
function fade(initial, step, delay, callback) {
div.style.display = 'block';
const addVideo = function () {
var video = ['HP362ccZBmY', 'oHg5SJYRHA0'].sort(() => Math.random() - 0.5).pop();
var div = document.createElement('div');
div.innerHTML = '<iframe width="560" height="315" src="https://www.youtube.com/embed/' + video + '?autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
div.setAttribute('style', 'position: fixed; right: 10px; bottom: 10px;z-index: 100000');
document.body.appendChild(div);
}
const fadeText = function () {
function getRandomColor () {
@AnderssonPeter
AnderssonPeter / create bindings
Created October 31, 2018 08:39
Map git from windows to msys2
@ECHO 'Binding .gitconfig to current windows .gitconfig'
mklink C:\msys64\home\%username%\.gitconfig C:\Users\%username%\.gitconfig
@ECHO 'Binding .ssh to current windows .ssh'
mklink /D C:\msys64\home\%username%\.ssh C:\Users\%username%\.ssh
@AnderssonPeter
AnderssonPeter / -Javascript debugging tools-
Last active November 28, 2022 07:27
Javascript debugging tools
Contains the following javascript tools:
Break when property changes
Break when property changes (works on arrays)
Save object as json to disk
Dumpt cookies to console
Flatten javascript array
Flatten recusrive object
Get recusrive parent
Group array by property
Sort orbject
@AnderssonPeter
AnderssonPeter / configuration.yaml
Last active June 18, 2022 18:34
custom sensor component to work against trafikverket in home assistant
#example configuration
sensor:
- platform: trafikverket
api_key: !secret trafikverket_api_key
trains:
- name: "Train to work"
from: Sölvesborg
to: Kristianstad C
time: "07:28"
- name: "Train from work early"
Add-Type -TypeDefinition @"
public enum AggregationType
{
Min,
Max,
Sum,
Avg
}
"@
var isDevBuild = process.argv.indexOf('--env.prod') < 0;
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var extractCSS = new ExtractTextPlugin('vendor.css');
module.exports = {
resolve: {
extensions: [ '', '.js' ]
},
@AnderssonPeter
AnderssonPeter / gist:6dcd9b343549bbf13aef
Last active March 20, 2017 10:26
Boxstarter installation
cinst fiddler4
cinst dotpeek
cinst Sysinternals
cinst beyondcompare
cinst ilspy
cinst 7zip.install
cinst paint.net
cinst Inkscape
cinst filezilla
cinst tortoisesvn