Skip to content

Instantly share code, notes, and snippets.

@franks42
franks42 / cljs_uuidv4.cljs
Created November 28, 2012 06:34
UUID generation algorithm for a v4/random UUID
(ns cljs-uuidv4
"Generator for a v4/random UUID that works with cljs.core/UUID"
(:require [goog.string.StringBuffer]))
(defn UUIDv4
"Returns a new randomly generated (version 4) cljs.core/UUID,
like: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
as per http://www.ietf.org/rfc/rfc4122.txt.
Usage:
@petehunt
petehunt / gist:8396968
Created January 13, 2014 09:14
Sweet.js DSL for making persistent data structures feel imperative
macro := {
rule infix { $obj $([ $key ] ...) | $rval:expr } => {
$obj = mori.assoc_in($obj, [$key (,) ...].reverse(), $rval)
}
}
macro hash_map {
rule {{ $($key : $value) (,) ... }} => {
mori.hash_map($($key, $value) (,) ...)
}
@pleasetrythisathome
pleasetrythisathome / form.cljs
Last active May 7, 2016 05:45
om forms - form parent local state as cursor
(def inputs [{:korks :email}
{:korks [:name :first]}
{:korks [:name :last]}])
(defn form [app owner]
(reify
om/IInitState
(init-state [this]
(reduce (fn [state {:keys [korks]}]
(assoc-in state korks nil))
@hongymagic
hongymagic / pr.md
Last active December 15, 2017 09:50 — forked from piscisaureus/pr.md
Checkout pull-requests from Atlassian Stash without adding remote

Locate the section for your stash remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@stash.internal:private/repository.git

Now add the line fetch = +refs/pull-requests/*:refs/remotes/origin/pull-requests/* to this section. Obviously, change the stash url to match your project's URL. It ends up looking like this:

@forresto
forresto / dynamicland-vneck-tshirt.lua
Last active August 30, 2018 06:44
first shot at dynamicland #softfab
-- Shirt (#softfab)
Claim (you) has state "waist" with initial value (30).
Claim (you) has state "arm" with initial value (5).
Claim (you) has state "armaround" with initial value (10).
Claim (you) has state "side" with initial value (20).
Claim (you) has state "neck" with initial value (15).
When (you) contains dots /dots/,
(you) has width /width/:
@antimatter15
antimatter15 / faketalk.js
Last active December 2, 2018 23:37
A toy system inspired by realtalk
function mouse(_, me, when, claim){
when('fox is out', () => {
claim(me, 'wish', 'labelled', 'squeak')
claim(me, 'wish', 'outlined', 'red')
})
}
function fox(_, me, when, claim){
claim('fox is out')
}
@facundoolano
facundoolano / webrtc.md
Last active May 16, 2019 12:58
webrtc.md

WebRTC

WebRTC is a free, open project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. It's supported by most major browsers (except Safari).

WebRTC APIs

To acquire and communicate streaming data, WebRTC implements the following APIs:

  • MediaStream: get access to data streams, such as from the user's camera and microphone.
anonymous
anonymous / gist:b1f303426e51f8509a0b
Created June 4, 2014 21:14
processing motion blur
// Processing motion blur
// 'time' runs from 0 to 1
// ignore everything above the /////////
// by Dave @ beesandbombs
int[][] result;
float time;
void setup() {
setup_();
Back at the theater in Tripoli, it was the year 1885, the first theater in the Middle East.
The vendor woman, an old Alawite, told us that once they had rolled the red carpet all the
way from the harbor to the theater for Oum Kalthoum to perform at the glorious Ottoman building.
There was nothing but rubble to be seen now, and the sound of diggers and hammers.
The Ingea Theater was no more. Now I recalled, it was Rabih Mroué who had asked Catherine Deneuve
in that film, "You wanted to see, I also want to see but I can't seem to. Do you see that?"
And the truth is that neither of us would see anything, but diggers, hammers and rubble.
It wasn't only the theater, but the city and the whole country, there was nothing to see but rubble.
At some point I wanted to ask him if maybe the whole world was made of rubble now.
As we drove away, he told me: "You know, we, the Lebanese and the Jews, we are perhaps the first
URL: https://apple.stackexchange.com/questions/340942/applescript-how-can-i-get-ui-elements-names-attributes-properties-classe/
When I started to search for an AppleScript's generic way to "click onto Safari's context menu" of a selected item, there were a lot of questions on "how-to" on several levels of nomenclature.
How can I, without having to use Accessibility Inspector, investigate what "categories" of AppleScript UI elements an application is offering and what additional details AppleScript knows about them?
ANSWER 1:
This is a "study" –an *attempt*– to find pragmatic ways to identify and "use" AS's UI elements:
------------------------------------------------------------------------