Skip to content

Instantly share code, notes, and snippets.

@drhisham-code
drhisham-code / render-state.ts
Created November 16, 2020 11:40 — forked from steveruizok/render-state.js
Render a State Designer state in the terminal.
import log from "ololog"
class Grid {
rows = []
width = 0
height = 0
chars = {
active: ["┌", "─", "┒", "┃", "┛", "━", "┕", "│"],
inactive: ["┌", "─", "┐", "│", "┘", "─", "└", "│"],
@drhisham-code
drhisham-code / image_downloader.js
Created October 23, 2020 09:55 — forked from sfrdmn/image_downloader.js
Bookmarklet to download all images on a page
;(function() {
var images = [].slice.call(document.querySelectorAll('img'))
try {
images.forEach(function(img) {
downloadImage(img)
})
} catch (e) {
alert("Download failed.");
console.log('Download failed.', e);
}
@drhisham-code
drhisham-code / easings.css
Created July 24, 2020 09:24 — forked from argyleink/easings.css
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

/*
It's now a package. You can find it here:
https://github.com/joshnuss/svelte-local-storage-store
*/
// Svelte store backed by window.localStorage
// Persists store's data locally
//
// AppDelegate.swift
// test
//
// Created by IOANNIS DELIGIANNIS on 1/2/16.
// Copyright © 2016 IOANNIS DELIGIANNIS. All rights reserved.
//
import Cocoa
@drhisham-code
drhisham-code / clickdrag.swift
Created May 23, 2020 09:12 — forked from jgthms/clickdrag.swift
Click drag mouse to specific position and dimension via command line in Mac OS
#!/usr/bin/env xcrun swift
import Foundation
let firstDelayUSec : useconds_t = 2000_000
let kDelayUSec : useconds_t = 500_000
func DragMouse(from p0: CGPoint, to p1: CGPoint) {
let mouseDown = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseDown, mouseCursorPosition:p0, mouseButton:.left)!
let mouseDrag = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseDragged, mouseCursorPosition:p1, mouseButton:.left)!
let mouseUp = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseUp, mouseCursorPosition:p1, mouseButton:.left)!
//
// DraggingValidator.swift
// Stash
//
// Created by Cory Sullivan on 2019-03-09.
// Copyright © 2019 Cory Sullivan. All rights reserved.
//
import Cocoa