SPC
SPCfind file,switch bufferA.browse files:MX;EX<switch buffer
| class MyJob < ActiveJob::Base | |
| queue_as :urgent | |
| rescue_from(NoResultsError) do | |
| retry_job wait: 5.minutes, queue: :default | |
| end | |
| def perform(*args) | |
| MyService.call(*args) | |
| end |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| # Emily Gorcensky's "obnoxious" fizz-buzz (less-compact version) annotated for non-python geeks. | |
| # Explanation via Twitter: https://twitter.com/EmilyGorcenski/status/1228407309656903680?s=20 | |
| # If you want to dive into the meanings of how it works: it models fizzbuzz by | |
| # computing the isomorphism of the finite cyclic groups of the values of the | |
| # fizzes and buzzes and whatnot. | |
| # | |
| # These abelian groups are mapped to the unit circle in the complex plane and | |
| # Represented as roots of unity. Such a interpetation has a polynomial | |
| # representation. Therefore, the cartesian product in the isomorphism is | |
| # represented as polynomial multiplication. The coefficients of a Polynomial |
| def paralleln(items : Indexable(T), &block : T -> R) forall T, R | |
| results = Array(R).new(items.size) { r = uninitialized R } | |
| done = Channel(Exception?).new | |
| items.each_with_index do |item, i| | |
| spawn do | |
| begin | |
| results[i] = block.call(item) | |
| rescue e | |
| done.send e |
| var net = require('net'); | |
| var fs = require('fs'); | |
| var os = require('os'); | |
| var path = require('path'); | |
| // Create server to listen for additional application launches | |
| function listenForNewProcesses(socketPath) { | |
| // create a server for listening on the socket path | |
| var server = net.createServer(function(connection) { | |
| connection.on('data', function(data) { |
| ;;;; pretty-literals.lisp - pretty hash table & vector literal syntax | |
| ;;;; inspired by and uses code from http://frank.kank.net/essays/hash.html | |
| (in-package #:pretty-literals) | |
| ;; vector literal syntax using brackets | |
| (set-macro-character #\[ | |
| (lambda (str char) | |
| (declare (ignore char)) | |
| (let ((*readtable* (copy-readtable *readtable* nil)) |
| #lang racket | |
| (require parser-tools/lex | |
| (prefix-in re- parser-tools/lex-sre) | |
| parser-tools/yacc) | |
| (provide (all-defined-out)) | |
| (define-tokens a (NUM VAR)) | |
| (define-empty-tokens b (+ - EOF LET IN)) | |
| (define-lex-trans number | |
| (syntax-rules () |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2
| <textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
| ... | |
| <textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
| ... | |
| <script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
| <script> | |
| // Hook up ACE editor to all textareas with data-editor attribute | |
| $(function () { |