Skip to content

Instantly share code, notes, and snippets.

View yspreen's full-sized avatar
🦆
Working

Nick Spreen yspreen

🦆
Working
View GitHub Profile
@yspreen
yspreen / index.html
Created February 10, 2019 16:11
Mars 404 Error Page
<div class="mars"></div>
<img src="https://mars-404.templateku.co/img/404.svg" class="logo-404" />
<img src="https://mars-404.templateku.co/img/meteor.svg" class="meteor" />
<p class="title">Oh no!!</p>
<p class="subtitle">
You’re either misspelling the URL <br /> or requesting a page that's no longer here.
</p>
<div align="center">
<a class="btn-back" href="#">Back to previous page</a>
</div>
@yspreen
yspreen / useful.js
Last active January 15, 2019 21:40
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();
setInterval(() => $(".icon-oj:not([src='/images/repliers/crownIcon.png'])").each(function() {$(this).parents("li").remove()}), 100);
i = setInterval(() => {return window.scrollTo(0,document.body.scrollHeight);}
, 1000);
@yspreen
yspreen / script.js
Last active October 30, 2018 14:15
JS snippets
function toBin(i) {
let s = "", flip = i < 0;
i = flip ? ~i : i;
while (i != 0) {
s = (flip ? 1 - (i & 1) : (i & 1)) + s;
i >>= 1;
}
return (flip ? "…1" : "") + (s == "" ? (flip ? "1" : "0") : s);
@yspreen
yspreen / mac_change.bat
Last active July 19, 2018 20:30 — forked from iJos/mac_change.bat
[BAT] Randomly change the Mac Address on Windows
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS
if "%~1"=="" goto blank
set /a x=0
::Generate and implement a random MAC address
FOR /F "tokens=1" %%a IN ('wmic nic where physicaladapter^=true get deviceid ^| findstr [0-9]') DO (
@yspreen
yspreen / install_python3.sh
Last active July 13, 2018 09:45
Install Python 3 on Pi
#!/bin/bash
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar xf Python-3.6.5.tar.xz
cd Python-3.6.5
./configure
make -j4
sudo make install
@yspreen
yspreen / useful.sh
Last active November 11, 2019 23:21
Useful bash snippets
alias dockerlogs='docker exec -i -t `docker ps | grep '\''python man'\'' | grep -o '\''^[^ ]*'\''` bash'
alias gitrmbranches='git branch --merged | grep -v \* | xargs git branch -D'
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
alias random_pw='LC_ALL=C tr -dc "A-Za-z0-9-_" </dev/urandom | head -c 20 ; echo'
alias kraken='LC_CTYPE=C open -na GitKraken --args -p "$(git rev-parse --show-toplevel)"'
alias wifion='networksetup -setnetworkserviceenabled Wi-Fi on'
@yspreen
yspreen / windowsgerman.keylayout
Created April 20, 2018 17:33
macOS keyboard layout for a german windows keyboard
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 3.2.7.195 on 2018-04-20 at 19:20 (CEST)-->
<keyboard group="126" id="-5083" name="Deutsch Windows" maxout="1">
<layouts>
<layout first="0" last="4" mapSet="fb0" modifiers="84"/>
<layout first="5" last="5" mapSet="18c" modifiers="84"/>
<layout first="8" last="9" mapSet="18c" modifiers="84"/>
<layout first="13" last="13" mapSet="18c" modifiers="84"/>
</layouts>
@yspreen
yspreen / windows.json
Created April 20, 2018 16:58
Karabiner configuration for Windows keyboard features
{
"title": "PC Style",
"rules": [
{
"description": "Home / End (except Chrome, Code, iTerm, Terminal and vim)",
"manipulators": [
{
"type": "basic",
"from": {
@yspreen
yspreen / script.scpt
Last active April 20, 2018 17:40
Fix Chrome Zoom behaviour with Applescript
-- Fix Chrome Zoom by yspreen
set dock_left to 1 -- Specify your dock position here!
set dock_bottom to 0 -- Specify your dock position here!
set dock_right to 0 -- Specify your dock position here!
set menu_bar_height to 22 -- change this!
-- Retina MacBooks probably have higher values.
-- Maximize Chrome, then run this script in the editor to see the output:
-- (*If chrome is currently in full-screen, your menu-bar height is:*)
-- (*22*)
@yspreen
yspreen / style.scss
Created March 22, 2018 20:17
SASS ultimate transition mixin [SCSS]
@function remove-nth($list, $index) {
$result: null;
@if type-of($index) != number {
@warn "$index: #{quote($index)} is not a number for `remove-nth`.";
} @else if $index == 0 {
@warn "List index 0 must be a non-zero integer for `remove-nth`.";
} @else if abs($index) > length($list) {
@warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`.";
} @else {