This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Stop zoom capture in Outlook | |
// @namespace Violentmonkey Scripts | |
// @match https://outlook.office.com/* | |
// @grant none | |
// @version 1.0 | |
// @author b | |
// @description 2/4/2025, 9:49:58 AM | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A debounce utility that does not wait around and does not use threads. | |
# | |
# Use DebounceFlusher.flush_on_finish{} to wrap any code | |
# that might call DebounceFlusher.run{} | |
# When the flush_on_finish block is complete, then any queued #run calls | |
# will be de-duplicated by the name provided to #run. | |
# The last call to #run for a specific name will be executed. | |
# | |
# NOTE, only one Thread will be able to execute this at a time due to the queue scope. | |
# Other threads will wait. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; add [net.sourceforge.jregex/jregex "1.2_01"] as a dependency. Better Regex than Java. | |
(ns text-helpers | |
(:import [jregex Pattern Replacer Substitution MatchResult TextBuffer])) | |
(defn hexify | |
"debug helper for determine Unicode hex value for a char." | |
[s] | |
(apply str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns example.cache-util | |
(:require [clojure.core.cache :refer [lru-cache-factory ttl-cache-factory]] | |
[clojure.core.cache.wrapped :refer [lookup-or-miss]] | |
)) | |
(defmacro defn-lru-ttl-cached-by-key | |
"Defines function name, which will cache using the return value of key-fn which is passed args. | |
If cache miss, will run the value-forms which will have args in scope." | |
[name doc | |
max-qty ttl-ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Example running HTTPKit REST JSON service | |
;; http://localhost:9843/api/example?q=12344 | |
;; http://localhost:9843/ | |
;; Add these to your project.clj | |
;; [ring "1.9.6"] | |
;; [ring/ring-defaults "0.3.4"] | |
;; [compojure "1.7.0"] | |
;; [http-kit "2.6.0"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateHttpLogsTable < ActiveRecord::Migration | |
def change | |
create_table :http_request_logs do |t| | |
t.datetime :created_at | |
t.string :request_method | |
t.text :path | |
t.jsonb :params | |
t.integer :http_status | |
t.integer :bytes_sent | |
t.integer :bytes_received |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import Ember from 'ember'; | |
import ENV from 'my-app/config/environment'; | |
Ember.ENV.DEBUG = true; | |
const {get} = Ember; | |
const ElasticSearchAdapter = DS.JSONAPIAdapter.extend({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
class Api::V2::FileStorageController < ApplicationController | |
skip_before_filter :authorize, :only => [:save, :serve] | |
before_filter :authorize_admin_api_token, :only => [:save] | |
def save | |
if params[:contents].is_a?(ActionDispatch::Http::UploadedFile) | |
params[:contents].close(false) # close and don't delete so we can import it | |
tmp_file = params[:contents] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PouchDB from 'pouchdb'; | |
import { Adapter } from 'ember-pouch'; | |
var db = new PouchDB('app-database'); | |
export default Adapter.extend({ | |
db: db, | |
// Generates something like: 9f6kf-xz6by | |
// Much nicer than a full uuid |