If you, like me, resent every dollar spent on commercial PDF tools,
you might want to know how to change the text content of a PDF without
having to pay for Adobe Acrobat or another PDF tool. I didn't see an
obvious open-source tool that lets you dig into PDF internals, but I
did discover a few useful facts about how PDFs are structured that
I think may prove useful to others (or myself) in the future. They
are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.
# This is something that I always forget and had a surprisingly hard time finding (or better yet, understanding). Here's the | |
# scenario: a colleague creates a new kubernetes cluster, named" cluster-foo.example.com". You want to look at it (for | |
# troubleshooting, updating the deployment, whatever). To get your kubectl installation to "see" the new cluster, take the | |
# following steps: | |
# ASSUMPTION: You have pointed kops to some location where the cluster configurations are stored | |
# (I have this in my ~/.bash_profile): | |
export KOPS_STATE_STORE=s3://example-state-store | |
# Use kops to get the list of clusters |
Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.
connect
is the most important thing in redux land IMO. This is where you tie the knot between redux and your underlying
components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational
<html> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<body> | |
<div id="content"> | |
</div> | |
</body> |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
.filter("timeago", function () { | |
//time: the time | |
//local: compared to what time? default: now | |
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes" | |
return function (time, local, raw) { | |
if (!time) return "never"; | |
if (!local) { | |
(local = Date.now()) | |
} |
#!/bin/bash | |
# from | |
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html | |
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png | |
convert favicon-256.png -resize 16x16 favicon-16.png | |
convert favicon-256.png -resize 32x32 favicon-32.png | |
convert favicon-256.png -resize 64x64 favicon-64.png | |
convert favicon-256.png -resize 128x128 favicon-128.png |