Quick helper to translate tif to tiles using parallel cpu.
$ tif_to_tiles.sh input.tif
gdalwarp will convert to output.tif, gdal2tiles_parallel.py will ingest output.tif and output PNGs to map_tiles folder.
| <?php | |
| /** | |
| * Convert a comma separated file into an associated array. | |
| * The first row should contain the array keys. | |
| * | |
| * Example: | |
| * | |
| * @param string $filename Path to the CSV file | |
| * @param string $delimiter The separator used in the file | |
| * @return array |
| #!/usr/bin/env ruby | |
| require 'selenium-webdriver' | |
| wd = Selenium::WebDriver.for :remote, url: 'http://10.3.1.7:4444/wd/hub', desired_capabilities: :chrome | |
| wd.navigate.to 'https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/' | |
| # Get the actual page dimensions using javascript | |
| # | |
| width = wd.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);") |
| // getComponent is a function that returns a promise for a component | |
| // It will not be called until the first mount | |
| function asyncComponent(getComponent) { | |
| return class AsyncComponent extends React.Component { | |
| static Component = null; | |
| state = { Component: AsyncComponent.Component }; | |
| componentWillMount() { | |
| if (!this.state.Component) { | |
| getComponent().then(Component => { |
This is a small hack that adds a page numbers at the bottom of the page. Using Puppeteer and a fixed height, the page will render at an A4 size via web and have a fixed footer.
await page.goto('https://bl.ocks.org/seripap/raw/81241195e182b62adc3c87c27258f85f/', {waitUntil: 'networkidle'});
await page.pdf({
path: 'hacks.pdf',
format: 'A4'
});| INSERT into parcel_state values | |
| (1, 'AL', 'Alabama', 1), | |
| (2, 'AK', 'Alaska', 2), | |
| (3, 'AZ', 'Arizona', 4), | |
| (4, 'AR', 'Arkansas', 5), | |
| (5, 'CA', 'California', 6), | |
| (6, 'CO', 'Colorado', 8), | |
| (7, 'CT', 'Connecticut', 9), | |
| (8, 'DE', 'Delaware', 10), | |
| (9, 'DC', 'District of Columbia', 11), |
| # Paths {{{ | |
| set folder = ~/Mail # mailbox location | |
| set alias_file = ~/.mutt/alias # where to store aliases | |
| set header_cache = ~/.mutt/cache/headers # where to store headers | |
| set message_cachedir = ~/.mutt/cache/bodies # where to store bodies | |
| set certificate_file = ~/.mutt/cerficates # where to store certs | |
| set mailcap_path = ~/.mutt/mailcap # entries for filetypes | |
| set tmpdir = ~/.mutt/temp # where to keep temp files | |
| set signature = ~/.mutt/sig # my signature file |
This is a Slack bot that automatically links to Linear.app issues. Sort of how like the Github autolinks work, except for Slack.
For example, you type Check out SE-12, the bot will then link to https://linear.app/{team}/se-12