Skip to content

Instantly share code, notes, and snippets.

View tigranpetrossian's full-sized avatar

Tigran Petrossian tigranpetrossian

  • Yerevan, Armenia
View GitHub Profile
View amalgo-box.ts
import invariant from "tiny-invariant";
class AmalgoBox extends HTMLElement {
get input() {
return this.querySelector("input") as HTMLInputElement;
get button() {
return this.querySelector("button") as HTMLButtonElement;
View gist:9b92186b87cc0d0dced51cf2b8ab386b
const text = css({
color: '$gray12',
variants: {
size: {
// corrective letter-spacing and text-indent styles
// should go here too, because they're determined by font-size.
// You could also put line-height here too, if your devs prefer
// a default line-height that works in some cases. But understand
// that line-height is also a function of line-length, so the
svallory /
Created October 25, 2021 00:26
Figma Plugin Development Live Reload

Figma Plugin Development Live Reload

  1. Create a somewhere in your project
  2. Copy the code from the file in this gist
  3. Install nodemon with yarn add --dev nodemon
  4. Add a script in the scripts property of your package.json replacing PLUGIN_CODE_FOLDER by the path to the folder where your plugin code lives
    "scripts": {

"livereload": "nodemon --watch PLUGIN_CODE_FOLDER --exec"

View preventWindowBounce.js
/// Self-Contained JavaScript to prevent window scroll overflow bounce on iOS devices
/// Checks for whitelisted native scrolling via .scrollable class or if -webkit-overflow-scrolling is an inline-style
window.PreventWindowBounce = {
handleEvent: function EventListenerInterface (ev) { if(ev.type in this) this[ev.type](ev); },
bindEvents: function () {
document.addEventListener('touchstart', PreventWindowBounce);
document.addEventListener('touchmove', PreventWindowBounce);
/// The code works by checking whether the scroll area is against
mbostock / .block
Last active March 22, 2023 13:34
HCL Color Picker
View .block
license: gpl-3.0
gubatron /
Last active September 2, 2023 16:26
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent
nickloewen /
Last active September 8, 2023 09:09
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.

Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

dypsilon /
Last active September 28, 2023 18:58
A badass list of frontend development resources I collected over time.
gka /
Created January 24, 2013 20:43
PHP Endpoint for Github Webhook URLs

PHP Endpoint for Github Webhook URLs

If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.

  1. Put github.php somewhere on your PHP-enabled web server, and make it accessible for the outside world. Let's say for now the script lives on