Skip to content

Instantly share code, notes, and snippets.

View marcolz's full-sized avatar

Marco Lazzeri marcolz

  • California
View GitHub Profile
@mistic100
mistic100 / vimeo-downloader.js
Created September 15, 2018 09:01
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@sebmarkbage
sebmarkbage / Enhance.js
Last active July 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@stevenharman
stevenharman / NSObject+Tap.h
Created June 12, 2013 18:16
A `tap` method for Objective-C, as inspired by Ruby. Thanks, @coreyhaines.
#import <Foundation/Foundation.h>
@interface NSObject (Tap)
- (id)tap:(void (^)(id))block;
@end
@toolmantim
toolmantim / Gruntfile.js
Created May 12, 2013 00:18
If you're using SASS, Grunt and Bower you may wonder "How do I @import the CSS file from a bower component I just installed?" Well I'm afraid you're asking the wrong question—@import is really only designed to import SCSS files (for now). But there is hope! grunt-contrib-sass also supports concatenation, and to use it simply include the CSS file…
module.exports = function(grunt) {
grunt.initConfig({
// ...
sass: {
styles: {
files: {
'sass/styles.css': [
'components/normalize-css/normalize.css',
(ns se.raek.html
(:import [org.ccil.cowan.tagsoup.jaxp SAXFactoryImpl])
(:require [clojure.xml :as xml]))
(defn startparse-tagsoup [s ch]
(.. (new SAXFactoryImpl) (newSAXParser) (parse s ch)))
(defn parse [s]
(xml/parse s startparse-tagsoup))
@anantn
anantn / getusermedia_picture.html
Created February 17, 2012 09:12
Take a picture with getUserMedia
<html>
<body>
<video id="v" width="300" height="300"></video>
<input id="b" type="button" disabled="true" value="Take Picture"></input>
<canvas id="c" style="display:none;" width="300" height="300"></canvas>
</body>
<script>
navigator.getUserMedia({video: true}, function(stream) {
var video = document.getElementById("v");
var canvas = document.getElementById("c");
@tmpvar
tmpvar / .gitignore
Created July 12, 2011 07:19
A console.log implementation that plays "nice" with large amounts of data. It Keeps node alive until the output has flushed to the screen.
gmon.out
v8.log
@romannurik
romannurik / centered_triangle.html
Created May 3, 2011 05:43
A simple CSS trick to create a horizontally- or vertically-centered 'selected' callout triangle using zero images.
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 40px;
}
a {
display: inline-block;
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"