- Clone this Gist.
- For card sizes other than A5, edit the
size
value in@page
, and theheight
andwidth
properties ofbody
. - Add contents to each face. The simplest approach is to add an image called
front.png
of the same dimensions as the card. - Generate a PDF from the HTML + CSS. If using Prince, it's as simple as
prince index.html card.pdf
. - Take the PDF to a printer, and ask them to print as many copies as you need.
node { | |
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
echo 'No quotes, pipeline command in single quotes' | |
sh 'echo $BUILD_NUMBER' // 1 | |
echo 'Double quotes are silently dropped' | |
sh 'echo "$BUILD_NUMBER"' // 1 | |
echo 'Even escaped with a single backslash they are dropped' | |
sh 'echo \"$BUILD_NUMBER\"' // 1 | |
echo 'Using two backslashes, the quotes are preserved' | |
sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
import { push } from 'connected-react-router'; | |
import { useCallback } from 'react'; | |
import { useDispatch } from 'react-redux'; | |
export default () => { | |
const dispatch = useDispatch(); | |
const action = useCallback((path: string) => dispatch(push(path)), [dispatch]); | |
const handleAction = useCallback((path: string) => () => action(path), [action]); | |
return { |
// Minimal middleware implementation | |
// Works in node and the browser | |
// Inspired by https://github.com/h2non/midware | |
// Usage examples are at the bottom... | |
function middleware(ctx) { | |
let calls = []; | |
let errorHandlers = []; | |
var ctx = ctx || null; |
var Middleware = function() {}; | |
Middleware.prototype.use = function(fn) { | |
var self = this; | |
this.go = (function(stack) { | |
return function(next) { | |
stack.call(self, function() { | |
fn.call(self, next.bind(self)); | |
}); |
I feel the need to have a little rant about MooTools and ES7 and the whole 'Array.contains' hoo-hah.
When MooTools came out in 2006, the most popular framework was Prototype. As the name suggests, it extended prototypes, as did MooTools. People still referred to making websites with JavaScript as 'DHTML', there was no trim method on strings, there wasn't even a forEach method on arrays. JavaScript was a crippled language. IE6 ruled the waves.
MooTools, Prototype, Dojo, Base2 - they made the language usable, even fun, to work with. By using an incredible feature of JavaScript, prototypical inheritance, we were able to add features to the language that made it palatable.
Be it simple methods like number.toInt, string.trim, array.forEach, or familiar programming constructs such as Class, MooTools and its ilk took JavaScript from something impossible to work with to something that you could properly use to build awesome sites, and even apps - Microsoft, IE and desktop ruled everything, and the concept of a 'we
On why stateful code is bad | |
=========================== | |
STUDENT: Sir, can I ask a question? | |
TEACHER: Yes! | |
STUDENT: How do you put an elephant inside a fridge? | |
TEACHER: I don't know. | |
STUDENT: It's easy, you just open the fridge and put it in. I have another question! | |
TEACHER: Ok, ask. | |
STUDENT: How to put a donkey inside the fridge? |
import cv2 | |
import time | |
import math | |
import numpy as np | |
capture = cv2.VideoCapture(0) | |
print capture.get(cv2.CAP_PROP_FPS) | |
t = 100 | |
w = 640.0 |
An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.
Everything is broken up by tag, but within each the selectors aren't particularly ordered.
I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A
A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:
-webkit-appearance:none;
/** | |
* Use em or rem font-size in Bootstrap 3 | |
*/ | |
@font-size-root: 14px; | |
@font-unit: 0rem; // Pick em or rem here | |
// Convert all variables to em |