This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hats off to https://gist.github.com/hackable/1294667 | |
var express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'), | |
fs = require('fs'); | |
var app = express.createServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Short script to auto format on save | |
MATCHING=false; | |
press(){ | |
xte "$1"; | |
if [ "x" = "$2x" ]; then | |
sleep 0.05; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.filter('parseUrl', function() { | |
var //URLs starting with http://, https://, or ftp:// | |
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim, | |
//URLs starting with "www." (without // before it, or it'd re-link the ones done above). | |
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim, | |
//Change email addresses to mailto:: links. | |
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; | |
return function(text, target, otherProp) { | |
if(!text) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tf.function | |
def histogram(x, y, | |
value_range, | |
nbins=100, | |
weights=None, | |
bin_dtype=tf.dtypes.int32): | |
""" | |
Bins x, y coordinates of points onto simple square 2d histogram | |
Given the tensor x and y: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# print usage | |
DOMAIN=$1 | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 tld" | |
echo "" | |
echo "This will generate a non-secure self-signed wildcard certificate for " | |
echo "a given development tld." | |
echo "This should only be used in a development environment." |