This gist contains two utilities:
parquet2json: a simple macos bash utility for converting parquet files to json using duckdb.from-parquet.nu: adds afrom parquetcommand to nushell.
| import { useRef } from 'react' | |
| /** | |
| * This could also be called `useDerived`. Works like useMemo, | |
| * except it guarantees that it only executes once per change of dependency values, | |
| * which is what `useMemo` is often expected to do, but doesn't guarantee, and doesn't | |
| * do in strict mode. | |
| * | |
| * Differs from `useEffect` in that the value is computed synchronously during render | |
| */ |
| #!/bin/bash | |
| ## This script uses the `convert` command from the imagemagick library to add a watermark to one or more images | |
| WATERMARK= # add your default watermark here | |
| WSIZE="20%" | |
| WPADDING="0" | |
| GRAVITY=SouthEast | |
| OUTDIR=watermarked | |
| DRYRUN= | |
| VERBOSE= |
| // Fixed an error with character replacement, removed a dependency, included imports, throw errors, and fixed global variables | |
| var crypto = require('crypto'); | |
| //remove a dependency on b64url | |
| function atob(str) { | |
| return new Buffer(str, 'base64').toString('binary'); | |
| } | |
| //this is not used here, but to leave it out would be like passing the salt without the pepper. | |
| function btoa(str) { |
| Drag this link to your bookmark bar to save as a bookmarklet: | |
| <a href="javascript:var s=document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='https://rawgit.com/bgmort/0fcf5971fe80e2c8ac13737caf9aa9b2/raw/mightytext-masstext.js'; void 0">Mighty Mass Text</a> |
| # run_multiple_commands.py | |
| import sublime, sublime_plugin | |
| # Takes an array of commands (same as those you'd provide to a key binding) with | |
| # an optional context (defaults to view commands) & runs each command in order. | |
| # Valid contexts are 'text', 'window', and 'app' for running a TextCommand, | |
| # WindowCommands, or ApplicationCommand respectively. | |
| class RunMultipleCommandsCommand(sublime_plugin.TextCommand): | |
| def exec_command(self, command): | |
| if not 'command' in command: | |
| raise Exception('No command name provided.') |
| <script type="text/javascript"> | |
| (function($){ | |
| var matches = location.pathname.match(/browse\/([A-Z]+-[0-9]+)/); | |
| if (matches) { | |
| $(document).ready(function() { | |
| /* | |
| * Add diffs to change logs | |
| */ | |
| var script = document.createElement('script'); |
| /** | |
| * converts like objects into a format which will serialize to a more compact JSON string | |
| */ | |
| function listToTable (list, cols){ | |
| var table = {}; | |
| for (var i = 0, item; item= list[i], i < list.length; i++){ | |
| for (var key in item){ | |
| if (item.hasOwnProperty(key)){ | |
| if (!table[key]) table[key] = []; | |
| table[key][i] = item[key] |
| <script type="text/javascript"> | |
| /* | |
| * add an 'edit all' option to issue pages | |
| */ | |
| (function(){ | |
| if (location.pathname == '/issues/' && location.hash == '#editall') { | |
| location.href = '/secure/views/bulkedit/BulkEdit1!default.jspa?reset=true' | |
| } | |
| else { | |
| var matches = location.pathname.match(/browse\/([A-Z]+-[0-9]+)/); |
| /** | |
| * Simple jquery function to trim a line of text with ellipses on left side, | |
| * like text-overflow: ellipsis clip will in Firefox only. Changes the text | |
| * permanently, so the amount of text hidden will not change when the window | |
| * is resized. | |
| * For this to work, the element you pass in needs to have overflow: hidden | |
| * and white-space: nowrap; | |
| * | |
| * http://stackoverflow.com/questions/9793473/text-overflow-ellipsis-on-left-side | |
| */ |