type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
module Jekyll | |
module Convertible | |
def write(dest) | |
path = destination(dest) | |
FileUtils.mkdir_p(File.dirname(path)) | |
if File.extname(path).downcase == '.html' then | |
self.output.strip! | |
reg = /<\/?pre[^>]*>/i | |
pres = self.output.scan(reg) | |
tary = self.output.split(reg) |
#usage: | |
#{% loop_directory directory:images iterator:image filter:*.jpg sort:descending %} | |
# <img src="{{ image }}" /> | |
#{% endloop_directory %} | |
module Jekyll | |
class LoopDirectoryTag < Liquid::Block | |
include Liquid::StandardFilters | |
Syntax = /(#{Liquid::QuotedFragment}+)?/ |
/Google\ Chrome\ Canary --enable-logging --v=1 --vmodule=*/webrtc/*=2,*/libjingle/*=2,*=-2 --enable-logging=stderr | |
// Easier: | |
/Google\ Chrome\ Canary --enable-logging --v=1 --vmodule=*/webrtc/*=2,*=-2 --enable-logging=stderr |
/* | |
glog-example | |
------------ | |
background | |
--- | |
You probably want to read the source code comments at the top of the glog.go file in | |
the golang/glog repository on github.com. Located here: https://github.com/golang/glog/blob/master/glog.go | |
setup |
/* | |
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets. | |
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there). | |
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ . | |
Known limitations: | |
- it won't be able to take into account some external stylesheets (if CORS isn't set up) | |
- it will produce false negatives for classes that are mentioned in the comments. |
# a refinement of https://stackoverflow.com/a/5255468/519360 | |
# see also my non-translating version at https://stackoverflow.com/a/28466267/519360 | |
# translate long options to short | |
reset=true stopped="" | |
for opt in "$@"; do | |
if [ -n "$reset" ]; then | |
unset reset | |
set -- # reset the "$@" array so we can rebuild it | |
fi |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
#!/bin/bash | |
kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"ExternalIP\"\)].address} |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" |
package build | |
import ( | |
"io" | |
"github.com/alecthomas/chroma" | |
"github.com/alecthomas/chroma/formatters/html" | |
"github.com/alecthomas/chroma/lexers" | |
"github.com/alecthomas/chroma/styles" | |
"github.com/russross/blackfriday" |