Skip to content

Instantly share code, notes, and snippets.

View superhawk610's full-sized avatar
🌠
drifting on a solar wind

Aaron Ross superhawk610

🌠
drifting on a solar wind
View GitHub Profile
@dschep
dschep / raspbian-python3.6.rst
Last active November 21, 2024 15:10 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@stevelacey
stevelacey / routers.py
Last active October 20, 2023 07:35
Django REST Framework custom API root view with permissions filter
from collections import OrderedDict
from myproject.api.views import APIRootView
from rest_framework import permissions, routers
from rest_framework_nested.routers import NestedSimpleRouter
class Router(routers.DefaultRouter):
include_root_view = True
include_format_suffixes = False
root_view_name = 'index'
@kitze
kitze / conditionalwrap.js
Created October 25, 2017 16:54
one-line React component for conditionally wrapping children
import React from 'react';
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children;
const Header = ({shouldLinkToHome}) => (
<div>
<ConditionalWrap
condition={shouldLinkToHome}
wrap={children => <a href="/">{children}</a>}
>
@shaggyrogers
shaggyrogers / neovim_startify_header.vim
Last active July 18, 2021 07:10
ascii art 'neovim' startify header
let s:startify_ascii_header = [
\ ' β–Ÿβ–™ ',
\ ' β–β–˜ ',
\ 'β–ˆβ–ˆβ–ƒβ–…β–‡β–ˆβ–†β–– β–—β–Ÿβ–ˆβ–ˆβ–ˆβ–ˆβ–™β–– β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„ β–ˆβ–ˆβ–„ β–„β–ˆβ–ˆ β–ˆβ–ˆ β–—β–Ÿβ–ˆβ–†β–„β–„β–†β–ˆβ–™β––',
\ 'β–ˆβ–ˆβ–›β–” β–β–ˆβ–ˆ β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆ β–ˆβ–ˆβ–›β–”β–”β–œβ–ˆβ–ˆ β–β–ˆβ–ˆ β–ˆβ–ˆβ–˜ β–ˆβ–ˆ β–ˆβ–ˆβ–›β–œβ–ˆβ–ˆβ–›β–œβ–ˆβ–ˆ',
\ 'β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–€β–€β–€β–€β–€β–˜ β–ˆβ–ˆβ–– β–—β–ˆβ–ˆ β–œβ–ˆβ–™β–Ÿβ–ˆβ–› β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ',
\ 'β–ˆβ–ˆ β–ˆβ–ˆ β–œβ–ˆβ–™β–„β–„β–„β–Ÿβ–Š β–€β–ˆβ–ˆβ–™β–Ÿβ–ˆβ–ˆβ–€ β–β–ˆβ–ˆβ–ˆβ–ˆβ–˜ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆ',
\ 'β–€β–€ β–€β–€ ▝▀▀▀▀▀ β–€β–€β–€β–€ β–€β–€ β–€β–€ β–€β–€ β–€β–€ β–€β–€',
\ '',
\]
@schmich
schmich / ducky.md
Last active May 6, 2025 15:26
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@jackdpeterson
jackdpeterson / dock.sh
Created April 4, 2018 18:05
Ubuntu 18.04 - Mixed DPI with 4k Laptop monitor (HiDPI), and two LoDPI monitors (27", 21")
#!/bin/bash
echo "setting frame buffer" &&
xrandr --fb 12800x2880 &&
echo "setting laptop monitor" &&
xrandr --output eDP-1-1 --mode 3840x2160 --rate 60 --primary&&
echo "setting 27 inch monitor" &&
xrandr --output DP-0.2 --mode 2560x1440 --scale-from 5120x2880 --panning 5120x2880+3840+0 --right-of eDP-1-1 &&
echo "setting the samsung monitor" &&
xrandr --output DP-0.1 --mode 1920x1080 --scale-from 3840x2160 --panning 3840x2160+8960+0 --right-of DP-0.2&&
echo "setting global scaling to 2x" &&
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active May 9, 2024 21:52
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
@souporserious
souporserious / getJSONFromFigmaFile.js
Created July 13, 2018 21:52
Generates JSON from Figma file
import request from 'request'
const api_endpoint = 'https://api.figma.com/v1'
const personal_access_token = 'FIGMA_ACCESS_TOKEN_HERE' // https://www.figma.com/developers/docs#auth-dev-token
function downloadSvgFromAWS(url) {
return new Promise((resolve, reject) => {
request.get(
url,
{
const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@fnky
fnky / ANSI.md
Last active June 1, 2025 14:22
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27