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
companies = [{"id":1,"ticker":"AAPL","name":"Apple Inc"}, | |
{"id":2,"ticker":"ABC","name":"Amerisourcebergen Corp"}, | |
{"id":3,"ticker":"ABT","name":"Abbott Labs"}, | |
{"id":4,"ticker":"ACE","name":"Ace Ltd"}, | |
{"id":5,"ticker":"ADBE","name":"Adobe Sys Inc"}] | |
_.templateSettings = interpolate :/\{\{(.+?)\}\}/g | |
$ -> |
;; Perl mode | |
(autoload 'cperl-mode "cperl-mode" "alternate mode for editing perl script." t) | |
(autoload 'perl-mode "perl-mode" "Edit perl script." t) | |
(setq auto-mode-alist | |
(append '(("cpanfile$\\|\\.\\([pP][Llm]\\|al\\|t\\|psgi\\)$" . cperl-mode) | |
("\\.cgi$" . cperl-mode)) auto-mode-alist )) | |
;;; cperl-mode | |
(custom-set-variables | |
'(indent-tabs-mode nil)) |
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
$self->search({ | |
'token_language_translations.id' => { -not => undef }, | |
'token_domain_id' => $token_domain_id, | |
'language_id' => $language_id, | |
-and => [ | |
'me.id' => { -not_in => \@ignore_ids }, | |
'me.id' => { -not_in => $self->search({ | |
'token_language_translation_votes.users_id' => $user_id, | |
'token_domain_id' => $token_domain_id, | |
'language_id' => $language_id, |
#!/usr/bin/env bash | |
# -r 60: 60 FPS | |
# -y: rewrite output file | |
# -start_number 11555: first frame number | |
# -i 'G%07d.JPG': file format | |
# -vf "crop=h=2250": video filter to crop input frame height from 3000 to 2250 (which will be eventually downscaled to 720) | |
# -c:v libx264: video codec x264 | |
# -crf 20: x264 encoding quality (less = better) | |
# -s 1280x720: output size |
A running example of the code from:
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.
/* | |
* Copyright (C) 2015 Jake Wharton | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# This script to install Kubernetes will get executed after we have provisioned the box | |
$script = <<-SCRIPT | |
# Install kubernetes | |
apt-get update && apt-get install -y apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: trusted-ca | |
namespace: kube-system | |
data: | |
ca.crt: |+ | |
-----BEGIN CERTIFICATE----- | |
MIIFkTCCA3mgAwIBAgIUCXaMcLg8teiGZ7o0dIQRIOdHEA8wDQYJKoZIhvcNAQEL | |
BQAweDELMAkGA1UEBhMCRlIxDDAKBgNVBAgMA04vQTEMMAoGA1UEBwwDTi9BMSAw |