GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).
#!/bin/sh | |
base=$1 | |
convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png" | |
convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png" | |
convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png" | |
convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png" | |
convert "$base" -resize '58x58' -unsharp 1x4 "[email protected]" | |
convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png" | |
convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png" | |
convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png" |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import argparse | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser(description=""" | |
I never freaking remember argparse syntax and the docs are so all over the place | |
that I need this for an example. |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
# from https://gist.github.com/MattDMo/6cb1dfbe8a124e1ca5af | |
import os | |
import json | |
import socket | |
import threading | |
activate_this = os.environ.get("SUBLIMEREPL_ACTIVATE_THIS", None) | |
# turn off pager |
Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.
The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key
from sre_parse import Pattern, SubPattern, parse as sre_parse | |
from sre_compile import compile as sre_compile | |
from sre_constants import BRANCH, SUBPATTERN | |
class Scanner(object): | |
def __init__(self, tokens, flags=0): | |
subpatterns = [] | |
pat = Pattern() |
# Copyright (c) 2016 Rob Kent (jazzycamel) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
# and associated documentation files (the "Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, publish, distribute, | |
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or | |
# substantial portions of the Software. |
# Instructions for 4.14 and cuda 9.1 | |
# If upgrading from 4.13 and cuda 9.0 | |
$ sudo apt-get purge --auto-remove libcud* | |
$ sudo apt-get purge --auto-remove cuda* | |
$ sudo apt-get purge --auto-remove nvidia* | |
# also remove the container directory direcotory at /usr/local/cuda-9.0/ | |
# Important libs required with 4.14.x with Cuda 9.X | |
$ sudo apt install libelf1 libelf-dev |