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 January 1, 2017 14:11 — forked from anonymous/index.html
JSON Table Experiment
<div class="container">
<div class="col-md-12">
<table class="table table-striped head">
<thead>
<tr>
<th>Text</th>
<th style="text-align:right">Time</th>
</tr>
</thead>
</table>
@yspreen
yspreen / Board.py
Last active January 15, 2017 13:35
Logiq Tower greedy solver
from Piece import Piece
from copy import deepcopy
class Board:
def __init__(self, data):
self.data = data
def copy(self):
return Board(deepcopy(self.data))
@yspreen
yspreen / django error
Last active September 17, 2017 17:15
Option 1: form = UploadForm(dict(), {'document': File(local_file)})
File "C:\Program Files\Python36\lib\site-packages\django\core\handlers\exception.py" in inner
41. response = get_response(request)
File "C:\Program Files\Python36\lib\site-packages\django\core\handlers\base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "C:\Program Files\Python36\lib\site-packages\django\core\handlers\base.py" in _get_response
@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 / 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 / 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 / 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 / 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 / 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 / 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);