// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
set -g prefix C-a | |
set -g status-bg black | |
set -g status-fg default | |
set -g status-left-length 20 | |
set -g status-left '#[fg=green]#H#[fg=default]' | |
set -g status-justify centre | |
set -gw window-status-format '#I#F#$ #W' | |
set -gw window-status-current-format '#[fg=red](#[fg=default]#I#F#[fg=yellow]⚡#[fg=default] #[fg=white]#W#[fg=default]#[fg=red])#[fg=default]' | |
set -g status-keys vi |
############################################################################ | |
# _ | |
# | |_ _ __ ___ _ ___ __ | |
# | __| '_ ` _ \| | | \ \/ / | |
# | |_| | | | | | |_| |> < | |
# \__|_| |_| |_|\__,_/_/\_\ | |
# | |
# Cheatsheets: | |
# https://devhints.io/tmux | |
# `property not found` issue: |
var mongoose = require('./index') | |
, TempSchema = new mongoose.Schema({ | |
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']} | |
}); | |
var Temp = mongoose.model('Temp', TempSchema); | |
console.log(Temp.schema.path('salutation').enumValues); | |
var temp = new Temp(); | |
console.log(temp.schema.path('salutation').enumValues); |
## keybindings | |
unbind C-b | |
unbind C-a | |
unbind % | |
unbind , | |
unbind . | |
unbind n | |
unbind p | |
unbind [ | |
unbind '"' |
I want to make a video to show my class of would-be IT people. If you write code, would you send me a video clip (webcam, less than 30s) with the following?
- Introduce yourself (name, where you work)
- Why you love what you do
- Why you love open-source software (optional, but would be super helpful)
Email the clip (or a link I can download the clip) to bphogan at gmail
and be sure to include your Twitter username so I can add that on your clip.
function map (arr, func) { | |
return Promise.resolve().then(function () { | |
return arr.map(function (el) { return func(el) }) | |
}).all() | |
} | |
function mapSeries (arr, func) { | |
let currentPromise = Promise.resolve() | |
let promises = arr.map(function (el) { | |
return currentPromise = currentPromise.then(function () { |
In order to configure the bitbucket hook we need two things: The user's API Token and the project token. In order to retrieve the first one whe should click on our username (on the top right corner of the page), click on configure and then click on "Show API Token". This API token will be used as password for our user.
For the project's token we need to go to the job configuration (/job/{job-name}/configure), "build triggers" and enable "trigger remote builds" and, there, input some random text as token.
Once we have these two tokens we can go to bitbucket, repo administration, hooks section, and add a new jenkins hook that we will configure like:
- Endpoint: http://{username}:{APIToken}@{hostname}/{prefix_if_you_have_one}
- Module name: Whatever (I usually leave this one blank)
- Project name: The job name
- Token: The project token