Skip to content

Instantly share code, notes, and snippets.

View actarian's full-sized avatar

Luca Zampetti actarian

View GitHub Profile
@actarian
actarian / object-watch.js
Created July 11, 2012 14:13 — forked from eligrey/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@actarian
actarian / 0_reuse_code.js
Created April 3, 2014 07:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@actarian
actarian / javascript_resources.md
Created April 3, 2014 07:05 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@actarian
actarian / css_resources.md
Created April 3, 2014 07:05 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@actarian
actarian / GlslCanvas.js
Last active June 24, 2018 09:54
GlslCanvas unique uniform
/*
The MIT License (MIT)
Copyright (c) 2015 Patricio Gonzalez Vivo ( http://www.patriciogonzalezvivo.com )
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
@actarian
actarian / ffmpeg-export-options.md
Last active February 4, 2021 08:24
FFMPEG alpha merge, color, clipping, jpg2000, webp, frame tiles

FFMPEG alpha merge, color, clipping, jpg2000, webp, frame tiles

sequence to jpeg2000

ffmpeg -i "c:\ffmpeg\in\hero\gbuffer_%05d.png" -pix_fmt yuv420p -vcodec jpeg2000 "c:\ffmpeg\out\hero\cover_%04d.jpeg"

sequence to webp

ffmpeg -i "c:\ffmpeg\in\hero\gbuffer_%05d.png" -pix_fmt yuv420p -codec libwebp "c:\ffmpeg\out\hero\cover_%04d.webp"


@actarian
actarian / rxcomp-app.module.js
Created December 16, 2019 15:24
RxComp - AppModule
import { Browser, CoreModule, Module } from 'rxcomp';
export default class AppModule extends Module {}
AppModule.meta = {
imports: [
CoreModule
],
declarations: [
TodoItemComponent,
@actarian
actarian / rxcomp-todo-item.component.js
Created December 16, 2019 15:26
RxComp - TodoItemComponent
export default class TodoItemComponent extends Component {
onChanges(changes) {
this.color = color(changes.item.id);
}
onToggle($event) {
this.toggle.next($event);
}
@actarian
actarian / rxcomp-syntax.html
Created December 16, 2019 15:27
RxComp - Declarative Syntax
<li class="list__item" *for="let item of items" [class]="{ done: item.done }" [style]="{ background: background, color: foreground, '--accent': accent }" todo-item-component [item]="item" (toggle)="onToggleItem($event)" (remove)="onRemoveItem($event)">
<button type="button" class="btn--toggle" (click)="onToggle(item)">
<div class="date" [innerHTML]="item.date | date : 'en-US' : { month: 'short', day: '2-digit', year: 'numeric' }"></div>
<div class="title" [innerHTML]="item.name"></div>
</button>
<button type="button" class="btn--remove" (click)="onRemove(item)">
<i class="icon--remove"></i>
</button>
</li>
@actarian
actarian / rxcomp-lifecycle.js
Created December 16, 2019 15:37
RxComp - LifeCycle Hooks
class MyComponent extends Component {
/**
* MyComponent instance has been initialized
* we can add custom properties to the instance
*/
onInit() {
// ...
}