Skip to content

Instantly share code, notes, and snippets.

View lozandier's full-sized avatar

Kevin Lozandier lozandier

View GitHub Profile

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@anaisbetts
anaisbetts / slack-login.html
Created October 26, 2015 05:26
RxJS + Polymer
<dom-module id="slack-login">
<style>
:host {
display: block;
}
#card {
min-width: 500px;
}
@ebidel
ebidel / imports_timing.js
Last active March 24, 2016 19:21
HTML Imports Resource Timing performance
// Know how fast your HTML Imports are.
// crbug.com/505279 - doesn't show sub-import resources.
var imports = document.querySelectorAll('link[rel="import"]');
[].forEach.call(imports, function(link) {
var entries = performance.getEntriesByName(link.href);
console.info('=== HTML Imports perf ===');
entries.forEach(function(e) {
console.log(e.name, 'took', e.duration, 'ms');
});
});
@sjmiles
sjmiles / pms.md
Last active June 7, 2018 00:55
Polymer Magic Server [DRAFT]

Polygit

Polygit is deprecated and only compatible with Bower and Polymer 1.0 & Polymer 2.0. As an alternative, use this Glitch to load dependencies via Bower.

Polygit serves files directly from github (via cdn.rawgit.com) in a manner that is compatible with HTML Imports natural deduplication feature.

Examples:

Load polymer from master branch (full debug mode)

@sjmiles
sjmiles / attributes.md
Last active August 29, 2015 14:23
[DRAFT] Curmudgeon's Corner: Attributes, Properties, and Bears, Oh My!

@sjmiles, 6/17/2015

... shooing away some flying monkeys ...

Attributes Use Dash-Case

First, when we use attributes in Polymer we always use dash-case for the name. In other words, we never write <x-foo coolSetting>, instead we always write <x-foo cool-setting>. This is true regardless of how we are going to use cool-setting, whether for styling, data binding, or whatever.

We do this because attributes in HTML are case-insensitive.

@ohanhi
ohanhi / frp.md
Last active December 23, 2022 13:06
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

<table>
<thead>
<tr>
<th>PID</th>
<th>Level</th>
<th>Message</th>
<th>When</th>
</tr>
</thead>
@tkadlec
tkadlec / perf.js
Created April 23, 2015 11:54
Super simple example of adding perf timing to the page display during dev work
(function () {
var perfBar = function(budget) {
window.onload = function() {
window.performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
var timing = window.performance.timing,
now = new Date().getTime(),
output, loadTime;
@ericelliott
ericelliott / defaults-overrides.md
Last active May 7, 2023 13:52
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
@jpillora
jpillora / smtp-gmail-send.go
Last active March 5, 2024 21:26
Send email using Go (Golang) via GMail with net/smtp
package main
import (
"log"
"net/smtp"
)
func main() {
send("hello there")
}