Skip to content

Instantly share code, notes, and snippets.

@busla
busla / gist:bbba5f39f65792e07d33
Created October 26, 2015 18:16
Dokku trace on rebuild (Earthquakes)
levy@projects:~$ dokku ps:rebuild earthquakes
+ parse_args ps:rebuild earthquakes
+ for arg in '"$@"'
+ case "$arg" in
+ for arg in '"$@"'
+ case "$arg" in
+ return 0
+ args=("$@")
+ [[ ps:rebuild =~ ^--.* ]]
+ has_tty
@busla
busla / parts.js
Created September 19, 2016 07:56
Font Awesome for SurviveJS tutorial (npm i font-awesome --save)
...
exports.loadFonts = function(paths) {
return {
module: {
loaders: [
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: "url",
query: {
@busla
busla / README.md
Last active November 21, 2016 07:52
Development environment for Yild providers

Yield provider development environment

One-liner for installing a fresh Drupal instance with Yild and contributed providers using a make file.

drush make drupal.make.yml your-drupal-folder-name && \
cd your-drupal-folder-name && \
drush si --db-url=mysql://user:pass@127.0.0.1:port/your-db-name --site-name="Yild provider development" --yes && \
drush en yild, yild_your_provider_name
@busla
busla / markdownx trace
Created May 1, 2017 22:04
markdownx traceback
Exception while resolving variable 'markdownx_editor' in template 'markdownx/widget2.html'.
Traceback (most recent call last):
File "/Users/levy/Code/innri/venv/lib/python3.5/site-packages/django/template/base.py", line 882, in _resolve_lookup
current = current[bit]
File "/Users/levy/Code/innri/venv/lib/python3.5/site-packages/django/template/context.py", line 87, in __getitem__
raise KeyError(key)
KeyError: 'markdownx_editor'
During handling of the above exception, another exception occurred:
@busla
busla / models.py
Created July 25, 2017 22:23
Django unique slug
from django.db import models
from django.urls import reverse
from unidecode import unidecode #pip install unidecode
from django.utils.crypto import get_random_string
from django.utils.text import slugify
from taggit.managers import TaggableManager
class Blog(models.Model):
title = models.CharField(max_length=256)
@busla
busla / instructions.md
Last active September 16, 2017 11:05 — forked from tpai/instructions.md
use both Tor and Privoxy with Mac OSX

1. install

brew install tor
brew install privoxy

2. copy and modify config file

{"features": [{"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.693056582112554, 63.99016915841572], [-21.693056582112554, 64.15258479868251], [[-21.98384658650274, 63.99016915841572], 64.15258479868251], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.83845158430765, 63.99016915841572], [-21.83845158430765, 64.07137697854911], [[-21.98384658650274, 63.99016915841572], 64.07137697854911], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.911149085405192, 63.99016915841572], [-21.911149085405192, 64.03077306848242], [[-21.98384658650274, 63.99016915841572], 64.03077306848242], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 64.
@busla
busla / kjordaemi.json
Last active March 21, 2018 11:47
Svæði kjördæma á Íslandi í geojson (gögn frá lmi.is, 2017-12-24)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@busla
busla / pathlib_vs_os_speed.py
Last active January 17, 2019 13:51
Simple (and probably naive) comparison between os and pathlib.Path when recursively crawling directories
import timeit
from pathlib import Path
from pathlib import Path
from datetime import datetime
import os
CHUNKS_DIR='/media/data/chunks'
PREFIX='segment-'
EXT='mp4'
@busla
busla / keybase.md
Created July 21, 2019 23:25
keybase

Keybase proof

I hereby claim:

  • I am busla on github.
  • I am jonlevy (https://keybase.io/jonlevy) on keybase.
  • I have a public key ASCuI07UeF_TBUQuXua6QztYeFCOm3E9cD1f4KK-lnHWlgo

To claim this, I am signing this object: