git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9
mv 6fb35afd237e42ef25f9 ConvertTo-Markdown
cd ConvertTo-Markdown
self: super: | |
{ | |
# Install overlay: | |
# $ mkdir -p ~/.config/nixpkgs/overlays | |
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix | |
userPackages = super.userPackages or {} // { | |
# Example: | |
hello = self.hello; |
import numpy as np | |
import matplotlib.pyplot as plt | |
def pdm(x): | |
n = len(x) | |
y = np.zeros(n) | |
error = np.zeros(n+1) | |
for i in range(n): | |
y[i] = 1 if x[i] >= error[i] else 0 | |
error[i+1] = y[i] - x[i] + error[i] |
# Prerequisites: netcat-openbsd (BSD version of netcat)
$ ssh -fND 127.0.0.1:8081 user@<your-vps>
$ git config --global url."https://github".insteadOf git://github
$ git config --global http.proxy 'socks5://127.0.0.1:8081'
$ echo -e 'Host github.com\nProxyCommand nc -x 127.0.0.1:8081 %h %p' >> ~/.ssh/config
Alternative solutions:
#include <iostream> | |
#include <string> | |
#include <functional> | |
#include "either.hxx" | |
using std::cout; | |
using std::endl; | |
using std::string; |
This post also appears on lisper.in.
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
CFLAGS=`pkg-config --cflags dbus-1` -Wall | |
LDFLAGS=`pkg-config --libs dbus-1` | |
all: dbus-example |
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |