Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
DEBIAN_PACKAGES="
apache2 \
curl \
default-jre-headless \
git \
python-pip
python-typogrify \
unzip \
@arobb
arobb / sierra-virtualbox-install.md
Last active November 24, 2020 13:15
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
@Circl3s
Circl3s / i3-popout.config
Created October 22, 2018 15:14
Pop-out player (or picture-in-picture, whatevs) for i3. Just slap in in the config and watch it do the magic. (For now works only on 1920x1080 xd)
# Pop-out player:
# Press mod+PageUp to pop out the current window: float it, resize it, stick it.
# Press mod+Shift+PageUp to enter edit mode.
bindsym $mod+Prior fullscreen disable, floating enable, resize set 576 324, sticky enable, move window to position 1322 735
bindsym $mod+Shift+Prior mode "$mode_popout"
set $mode_popout Pop-out player: (k) lower left, (l) lower right, (i) upper left, (o) upper right
mode "$mode_popout" {
# Change position
@Restuta
Restuta / howto-put-git-repo-into-another-repo.md
Last active April 22, 2021 16:43
How to make git repo to be another's repo subfolder preserving history

Hacky way (let me know if you know better one)

Let's say you have repo Main and repo Proto, you want to put your Proto under Main, so folder structure will be the following:

|-SRC
   |---proto

and you also want to preserve commit history, so everybody can see what you were doing while developing proto, sounds like pretty easy task. The easiest way is to create folder structure similar to Main repo SRC\proto and start working using is as a root, but if you like me, you didn't think about this beforehand, so you path would be harder:

Disco Flow Notebook
0: ["Botanical Gardens oil on canvas"],
130: ["Yggdrasil oil on canvas by Tobias Roetschvector art oil on canvas by Karla Knight"],
166: ["Yggdrasil oil on canvas by Tobias Roetsch"],
196: ["psychedelic hall of mirrors by johfra bosschart"],
217: ["360 degree photo sphere space architecture robot"],
243: ["psychedelic hall of mirrors by Philip Kirkland"],
272: ["psychedelic hall of mirrors by alex grey"],
298: ["eye oil on canvas by agnes lawrence pelton"],
@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@xiaoganghan
xiaoganghan / mynote.xml
Created July 27, 2012 07:26
Parsing Evernote export file (.enex) using Python
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20120727T073610Z" application="Evernote" version="Evernote Mac 3.0.5 (209942)">
<note><title>Vim Tips</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
yank for copy, delete for cut, put for parse
<div><br/></div>
<div>Move in context, not position</div>
<div>/ search forward</div>
@thepaul
thepaul / spawn_pager.py
Created September 9, 2011 17:06
the Right Way(tm) to Popen a curses-using subprocess
# works on Mac OS X and Linux. haven't tried BSD. obviously windows is out.
import os
import subprocess
import signal
def get_tty_fg():
# make a new process group within the same session as the parent. we
# do this so that if the user hits ctrl-c, etc in the curses program
# that's about to be exec'd, the SIGINT and friends won't be sent to
@ssokolow
ssokolow / x11_watch_active_window.py
Last active February 6, 2024 22:50
python-xlib example which reacts to changing the active window
#!/usr/bin/env python
"""python-xlib example which reacts to changing the active window/title.
Requires:
- Python
- python-xlib
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib
for Python 3.x.
@kfatehi
kfatehi / _list-github-pull-requests.md
Last active February 12, 2024 19:09
list pull requests across entire organization