Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dschep's full-sized avatar

Daniel Schep dschep

View GitHub Profile
@dschep
dschep / nvim-terminal-edit.py
Last active January 9, 2018 18:52 — forked from tarruda/nvim-terminal-edit.py
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
import os
import sys
from neovim import attach
args = sys.argv[1:]
addr = os.environ.get("NVIM_LISTEN_ADDRESS", None)
javascript: function runDownloadThing(howManyToDownload) {
if (!howManyToDownload) {
howManyToDownload = 3;
}
if (window['downloadSome']) {
window.downloadSome();
return;
}
var iter = $('div.download a.a:not([download])').toArray();
iter = iter.concat($('div.row a[download]').toArray());
@dschep
dschep / post-merge
Last active July 8, 2020 14:00 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `yarn` if yarn.lock changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — 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).

- name: Compute Vagrant latest version
sudo: no
shell: wget -qO - https://dl.bintray.com/mitchellh/vagrant/|sed -n 's/.*href=\"\([^"]*\).*/\1/p'|grep x86_64\.deb|tail -1|cut -d'%' -f2
register: vagrant_file_name
- name: Download Vagrant latest version
sudo: no
get_url: url="https://dl.bintray.com/mitchellh/vagrant/{{ vagrant_file_name.stdout }}" dest="/tmp/{{ vagrant_file_name.stdout }}"
- name: Install Vagrant latest version
@dschep
dschep / grid.js
Created October 11, 2012 20:38 — forked from webxl/grid.js
CSS prototyping bookmarklet
javascript:(function(){s1=document.createTextNode('.guidesOn::before { content:""; position:fixed; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjVJivzgAAAAyUlEQVRoQ%2B2abQqAIBBEPW1X6CzdqTv1RUFIipi2o72gPyXV7uybKci5wDZM8xI6dz%2Buvs6pP2Dq81GI2qiiiJkiOzQ97EGHTXUF9XUwYsaI2o1LjyqjpaYwiqDI2YFs2HtI9Wjx2Z0R%2B1ADdmB%2FC7taB0uzCSNqCqOImSIkeyW7xLXMZvqjdzJcS01hFEGRSnbe3miR7JVGgWRXcxkUQRFgj%2F8Y8htGtkJHL%2FvGaGtKd6bU9Z4C%2FCiEZDeCPahIa%2FbbDSNX433mVkIrV5rTnhDyAAAAAElFTkSuQmCC) 50% 0; z-index:1; top:0; right:0; bottom:0; left:0; opacity:.3; pointer-events:none; } * { -webkit-user-modify: read-write; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; } a { -webkit-user-modify: initial; }');s2=document.createTextNode('#a1_z { background-color: #fff; background-color: rgba(255,255,255,.8); float: left; position: fixed; z-index:2; padding: 3px; bo