;;; -*- lexical-binding: t; -*- | |
(defun image-tooltip-at-point () | |
"ポイントやマウスカーソルの下の画像ファイルをツールチップ内に表示します。 | |
使い方: | |
(define-key c-mode-map \"\\C-co\" 'image-tooltip-at-point) | |
(define-key c-mode-map [mouse-1] 'image-tooltip-at-point) | |
./very-sorry.png |
function inheritsObject(baseObject, superObject) { | |
Object.setPrototypeOf(baseObject, superObject); | |
} | |
function inheritsMultipleObjects(baseObject, superObjects) { | |
inheritsObject( | |
baseObject, | |
new Proxy({}, { | |
get(target, key, rec) { |
When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. That way you can keep each project in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. This intermediate guide covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda
). See the Using the workflow section to view the end result.
- Working on 2+ projects that each have their own dependencies; e.g., a Python 2.7 project and a Python 3.6 project, or developing a module that needs to work across multiple versions of Python. It's not reasonable to uninstall/reinstall modules every time you want to switch environments.
- If you want to execute code on the cloud, you can set up a Python environment that mirrors the relevant
FROM centos:7 | |
MAINTAINER "orion" <orion@thoughtspot.com> | |
# Steps needed to use systemd enabled docker containers. | |
# Reference: https://hub.docker.com/_/centos/ | |
ENV container docker | |
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ | |
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | |
rm -f /lib/systemd/system/multi-user.target.wants/*;\ | |
rm -f /etc/systemd/system/*.wants/*;\ |
import loadImage from 'loadImage' | |
const addImg = (src) => { | |
const imgEl = document.createElement('img') | |
imgEl.src = src | |
document.body.appendChild(imgEl) | |
} | |
const imgArr = [ | |
loadImage('images/cat1.jpg'), | |
loadImage('images/cat2.jpg'), |
from celery.schedules import crontab | |
CELERY_IMPORTS = ('app.tasks.test') | |
CELERY_TASK_RESULT_EXPIRES = 30 | |
CELERY_TIMEZONE = 'UTC' | |
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml'] | |
CELERY_TASK_SERIALIZER = 'json' | |
CELERY_RESULT_SERIALIZER = 'json' |
# Cordova Global | |
plugins/ | |
# iOS Platform | |
platforms/ios/build/ | |
platforms/ios/www/ | |
platforms/ios/cordova/console.log | |
*.xcuserdatad | |
# Android Platform |
Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.
The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.
It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential
# 1: Use node 6 as base: | |
FROM node:6-alpine | |
# 2: Download+Install PhantomJS, as the npm package 'phantomjs-prebuilt' won't work on alpine! | |
# See https://github.com/dustinblackman/phantomized | |
RUN set -ex \ | |
&& apk add --no-cache --virtual .build-deps ca-certificates openssl \ | |
&& wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz" | tar xz -C / \ | |
&& npm install -g phantomjs \ | |
&& apk del .build-deps |