Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| function getHightlightCoords() { | |
| var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1; | |
| var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex); | |
| var pageRect = page.canvas.getClientRects()[0]; | |
| var selectionRects = window.getSelection().getRangeAt(0).getClientRects(); | |
| var viewport = page.viewport; | |
| var selected = selectionRects.map(function (r) { | |
| return viewport.convertToPdfPoint(r.left - pageRect.x, r.top - pageRect.y).concat( | |
| viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y)); | |
| }); |
| // | |
| // Create a PDF by merging values from a Google spreadsheet into a Google Doc | |
| // ========================================================================== | |
| // | |
| // Demo GSheet & script - http://bit.ly/createPDF | |
| // Demo GDoc template - 1QnWfeGrZ-86zY_Z7gPwbLoEx-m9YreFb7fc9XPWkwDw | |
| // | |
| // Config | |
| // ====== |
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| // Gzip Compression |
| // Copyright (c) 2017 Ismael Celis | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: | |
| // The above copyright notice and this permission notice shall be included in all |
| #!/bin/bash | |
| sink_name="bluez_sink.00_42_1B_AD_FA_CE" | |
| if [ -z "$1" ]; then | |
| dbus-monitor --system "path=/org/bluez/777/hci0/dev_00_42_1B_AD_FA_CE, interface=org.bluez.AudioSink, member=Connected" | while read line; do | |
| echo $line | |
| $0 1 | |
| done | |
| else |
| // | |
| // File: fsevents_windows.go | |
| // Date: October 29, 2013 | |
| // Author: Peter Krnjevic <pkrnjevic@gmail.com>, on the shoulders of many others | |
| // | |
| // This code sample is released into the Public Domain. | |
| // | |
| package fsevents | |
| import ( |
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "log" | |
| "net/rpc" | |
| ) | |
| func main() { |
| //http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
| Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Using google geocoding API try to fix addresses in capsule | |
| """ | |
| import sys | |
| import argparse | |
| import requests |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000