Skip to content

Instantly share code, notes, and snippets.

@rb2
rb2 / markdown.syntax
Last active November 18, 2020 23:04
mcedit Markdown syntax
# Markdown syntax highlight config for MC (MidnigntCommander)
# (not full, but usable)
#
# https://gist.github.com/rb2/1f6b23ea5ea848c75a8c
#
# Authors:
# Ruslan Brest, http://rb.labtodo.com, 2013
#
# Usage:
#
@sirkkalap
sirkkalap / Install-Docker-on-Linux-Mint.sh
Last active December 8, 2022 18:38
Install Docker on Linux Mint
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x
##########################################
# Check that HTTPS transport is available to APT
if [ ! -e /usr/lib/apt/methods/https ]; then
sudo apt-get update
sudo apt-get install -y apt-transport-https
fi
@aidanhs
aidanhs / gist:5ac9088ca0f6bdd4a370
Last active March 19, 2024 16:01
Rust binary tree worked example

PLEASE DON'T USE THIS GUIDE

It's over 9 years old (as of 2024-02-18), there are many better guides! You might like https://rust-unofficial.github.io/too-many-lists/

% Let's build a binary tree!

Let's build a binary tree of strings in Rust. To recap, each node in a binary tree:

  1. must have a value
@joyrexus
joyrexus / README.md
Created January 5, 2015 18:24
js zip function
@rubo77
rubo77 / rotate-screen.sh
Last active October 9, 2023 11:30
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@pwalsh
pwalsh / wtforms-field-macro-bootstrap3.html
Last active September 5, 2022 17:44 — forked from alienhaxor/_formhelpers.py
A macro for rending WTForm fields in Jinja2 templates with Bootstrap 3 styling.
{% macro render_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = kwargs.pop('placeholder', field.label.text) %}
{% set class_ = kwargs.pop('class_', '') %}
{% if field.flags.required %}
{% set class_ = class_ + ' required' %}
{% endif %}
# Natural Language Toolkit: WordNet
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Steven Bethard <Steven.Bethard@colorado.edu>
# Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Nitin Madnani <nmadnani@ets.org>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, unicode_literals
@nlothian
nlothian / Penn Treebank II Tags.md
Last active January 29, 2024 19:54
Penn Treebank II Tags
defmodule NumbersInput do
def start do
IO.stream(:stdio, :line)
|> Stream.flat_map(&tokenize/1)
|> Stream.take_while(&(&1 > -1))
end
defp tokenize(line) do
line
|> String.split(" ")
defmodule BitString.Example do
import BitString
defbitstring data_frame do
_ :: 1
stream_id :: 31
flags :: 8
length :: 24
_ :: 1
_ :: 7