Skip to content

Instantly share code, notes, and snippets.

Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.

  • don't upload a video file, they will re-encode it into absolute 💩

  • create a GIF, which they will auto-convert into a video file 😱

  • The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,

@rsms
rsms / Makefile
Last active February 28, 2024 01:31
Demonstrates a method for remote rendering with Skia. First run build-skia-macos.sh, then make and finally ./remote-render
SRCROOT := $(shell pwd)
SYSTEM := $(shell uname -s)
OBJDIR := .build
SKIA_DIR := skia
SOURCES := remote-render.cc
# skia-compatible config sourced from skia/out/Release/obj/remote_demo.ninja
# via temporarily configuring Skia with skia_enable_tools=true
@piskov
piskov / cmd to birman.json
Created March 11, 2021 20:46
Command to birman layout switcher
{
"title": "Change keyboard layout on cmd press",
"rules": [
{
"description": "Change input source to En Birman by left_command; Ru Birman by right_command.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
@tkachenko1503
tkachenko1503 / why-do-we-need-types-in-javascript.md
Last active April 21, 2020 10:35
Do we need types in JavaScript? Or maybe not?

This is my lightning talk submission to ReactiveConf 2018 https://reactiveconf.com/

In this talk, I want to share my experience gained during the development of frontend applications in several programming languages.

I think it's not a secret for anybody that developing large JavaScript applications is not so easy as it seems at first glance. We all want something simpler and more reliable. Therefore, many developers and even entire companies switch to different, compiled in JavaScript, programming languages. The bulk of such transitions is accounted for TypeScript and flow, and often, developers faced with more problems than they were before.

I wasn't the exception. Moving to a new project, I started using TypeScript and was disappointed. Luckily in my next project I used ClojureScript and it was like everything is illuminated!

(ns your.macros-for-cljs.ns
(:require [sablono.compiler :as sablono-c]))
;; Make sablono also walk into other forms:
;; if, for, let, do: Already exist
(.addMethod @(var sablono-c/compile-form) "when"
(fn
[[_ bindings & body]]
`(when ~bindings ~@(for [x body] (sablono-c/compile-html x)))))
@plaidfinch
plaidfinch / pretty-pragmata.el
Last active July 15, 2021 01:56
Mappings for prettify-symbols-mode to enable Pragmata Pro's ligatures in Emacs. I've taken some slight liberties with the original ligature map, to suit my own tastes.
;; PRETTIFY SYMBOLS (with Pragmata Pro)
(defun setup-pragmata-ligatures ()
(setq prettify-symbols-alist
(append prettify-symbols-alist
'(("!!" . ?)
("!=" . ?)
("!==" . ?)
("!≡" . ?)
("!≡≡" . ?)
("!>" . ?)
@DeLaGuardo
DeLaGuardo / pragmatapro-font-lock-symbols-v2.el
Last active February 28, 2024 01:27
Snippet for support ligatures from PragmataPro font in Emacs
;; Enable ligatures without prettify-symbols
(provide 'add-pragmatapro-symbol-keywords)
(defconst pragmatapro-fontlock-keywords-alist
(mapcar (lambda (regex-char-pair)
`(,(car regex-char-pair)
(0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@fogus
fogus / gist:3123867
Created July 16, 2012 17:21 — forked from stuarthalloway/gist:2645453
Datomic queries against Clojure collections
;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")
anonymous
anonymous / collector.erl
Created June 9, 2012 13:47
-module(collector).
-behaviour(gen_server).
-export([start_link/1, do/2, ended/0]).
-export([handle_call/3, handle_cast/2]).
-export([init/1, terminate/2, handle_info/2, code_change/3]).
%% Client interface