Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |
On mac:
/usr/local/bin
.having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (.html
, .js
etc.) in a browser via http://
.
if you're not sure whether or not you have a web server running, no problem! its easy to confirm.
#!/bin/bash | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by [email protected] | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# modified by superfawkes - correct whitespaces in aconway's patch for Crucible, handle whitespaces for BSD/OSX styled sed | |
# | |
# Generate an SVN-compatible diff against the tip of the tracking branch | |
# Get the tracking branch (if we're on a branch) |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
# Build neural network | |
net = tflearn.input_data(shape=[None, 5]) | |
net = tflearn.fully_connected(net, 32) | |
net = tflearn.fully_connected(net, 32) | |
net = tflearn.fully_connected(net, 2, activation='softmax') | |
net = tflearn.regression(net) | |
# Define model and setup tensorboard | |
model = tflearn.DNN(net, tensorboard_dir='tflearn_logs') | |
# Start training (apply gradient descent algorithm) |
import http.server | |
import socketserver | |
from http import HTTPStatus | |
class Handler(http.server.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(HTTPStatus.OK) | |
self.end_headers() | |
self.wfile.write(b'Hello world') |
#!/usr/bin/env python3 | |
import http.server | |
import socketserver | |
PORT = 8000 | |
Handler = http.server.SimpleHTTPRequestHandler | |
Handler.extensions_map.update({ | |
'.wasm': 'application/wasm', |
#include <random> | |
double random(void) { | |
static std::mt19937 generator(time(0)); | |
static std::uniform_real_distribution<double> distribution(0, 1); | |
return distribution(generator); | |
} |