Skip to content

Instantly share code, notes, and snippets.

View lifeart's full-sized avatar
🐹
Working from home

Alex Kanunnikov lifeart

🐹
Working from home
View GitHub Profile
@lukemelia
lukemelia / 1-summary.md
Last active July 2, 2020 19:41
Simple component theming with broccoli.js

My team and I have been working on a new internal component library to share across a few Ember apps. The library is an Ember addon in a private github repo. So far, so good. The off-the-beaten-path part of our requirements is that the components need to be themeable. Specifically, we support a color and a "light" or "dark" aesthetic.

We want a great developer experience for creating and updating these components, so we used ember-freestyle as a devDependency of the library to create a living style guide. We added some UI to allow theme switching and even a checkbox to switch themes every second (thanks ember-concurrency!).

The thing that gave us the biggest challenge was figuring out how to author and apply the styles that were necessarily dynamic. Specifically, the css rules that used the dynamic color.

We decided to organize our styles like so:

app/styles/components/
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active March 28, 2024 09:37
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@Rich-Harris
Rich-Harris / service-workers.md
Last active March 15, 2024 03:03
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
#define EPSILON 1.0e-5
#define RESOLUTION 32
class Point2D
@listochkin
listochkin / Ссылки-JSunderhood
Created May 31, 2015 13:49
Неделя jsunderhood. Все ссылки, которыми я с вами поделился
Неделя jsunderhood. Все ссылки, которыми я с вами поделился
http://blog.vjeux.com/2014/javascript/react-css-in-js-nationjs.html
http://bost.ocks.org/mike/algorithms/
http://cdn.mozilla.net/pdfjs/tracemonkey.pdf
http://confreaks.tv/videos/keeprubyweird14-opening-keynote
http://confreaks.tv/videos/rubyconf2014-the-social-coding-contract
http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/
http://ember.js/posts/animations-in-emberjs-with-liquidfire
http://frameworksdays.com/event/mk-listochkin-emberjs/participants
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active February 11, 2024 06:48
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@goncalossilva
goncalossilva / gifenc.sh
Last active December 12, 2023 22:31
Encode mp4, webm and gif using ffmpeg (2.6 or above). Audio is discarded on all of these!
#!/bin/sh
# sh gifenc.sh input.mp4 output.gif
# Optionally accepts width / height (one or both).
palette="/tmp/palette.png"
filters="fps=15"
if [ -n "$3" ]; then
if [ -n "$4" ]; then
filters="$filters,scale=$3:$4"
@revolunet
revolunet / browserify.js
Last active January 9, 2018 15:18
Sample split grunt-browserify config for vendors + applications files with react
var externalModules = [
'fs',
'events',
'react',
'react-addons',
'lodash'
];
module.exports = {
vendors: {
@listochkin
listochkin / ember.js-videos.md
Last active January 12, 2024 14:32
Ember.js Video Collection
  1. Официальные видео:
  2. Toran Billups записал очень хорошие базовые видео:
  3. Архитектура: