First install the required gems:
gem install octokit awesomeprint rainbowThen run it to extract all of your open GitHub issues into files (with comments).
ruby my-gh-issues.rbFirst install the required gems:
gem install octokit awesomeprint rainbowThen run it to extract all of your open GitHub issues into files (with comments).
ruby my-gh-issues.rb| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |
| -- Accepted answer from here: https://stackoverflow.com/questions/5408156/how-to-drop-a-postgresql-database-if-there-are-active-connections-to-it | |
| SELECT pg_terminate_backend(pg_stat_activity.pid) | |
| FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = '[your database name goes here]' | |
| AND pid <> pg_backend_pid(); |
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>| #!/bin/bash | |
| for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$') | |
| do | |
| git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes | |
| if [ $? -ne 0 ]; then | |
| echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint." | |
| exit 1 # exit with failure status | |
| fi | |
| done |
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the active virtualenv | |
| # * the branch of the current git/mercurial repository | |
| # * the return value of the previous command | |
| # * the fact you just came from Windows and are used to having newlines in | |
| # your prompts. |
| class NonHtmlDebugToolbarMiddleware(object): | |
| """ | |
| The Django Debug Toolbar usually only works for views that return HTML. | |
| This middleware wraps any JSON response in HTML if the request | |
| has a 'debug' query parameter (e.g. http://localhost/foo?debug) | |
| """ | |
| @staticmethod | |
| def process_response(request, response): | |
| if request.GET.get('debug'): |
| From: https://blog.lobraun.de/2015/06/06/mount-sd-cards-within-virtualbox-on-mac-os-x/ | |
| Mount SD Cards within VirtualBox on Mac OS X | |
| Sometimes you need to mount your SD cards inside a VirtualBox machine to work with the files on the card. Working with the Raspberry Pi SD card on Mac OS X is an example for this. | |
| My Raspberry Pi runs on Linux with some version of the EXT file system. While there is some support for this on Mac OS X, the available solutions have a lot of limitations, especially when it comes to write support on EXT file systems. As I do not have an USB keyboard, I sometimes need to mount the filesystem on another system to fix a startup problem when some of my experiments go wrong. | |
| VirtualBox in theory allows for passing the internal card reader of the MacBooks to the virtual machine. Unfortunately, this does not work for me (and it seems for many other people). |
| """ | |
| Physics simulation with PyODE followed by a (basic) rendering with Vapory | |
| See the result here: http://i.imgur.com/TdhxwGz.gifv | |
| Zulko 2014 | |
| This script is placed in the Public Domain (Licence Creative Commons 0) | |
| """ |
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| import subprocess | |
| # Script taken from doing the needed operation | |
| # (Filters > Remeshing, Simplification and Reconstruction > | |
| # Quadric Edge Collapse Decimation, with parameters: | |
| # 0.9 percentage reduction (10%), 0.3 Quality threshold (70%) |