Skip to content

Instantly share code, notes, and snippets.

View coxato's full-sized avatar
💻

Carlos Martínez coxato

💻
View GitHub Profile
this video was created earlier in january from a stupid idea and was driven by sheer determination
despite lacking programming skill. here's a decent description of how it was made (because i am
too lazy to write a github readme):
1. the video
i downloaded the pv off youtube and used ffmpeg to resize it down to 70x54 dimensions (for easy
math calculations, i used 27 firefox windows, 7 tabs each, so it divided nicely). i then used
ffmpeg (again) to splice the source video into 15-second segments to reduce desyncing and cpu load.
2. the frames
@coxato
coxato / firestoreAPI.dart
Created January 16, 2021 07:43
firestore: get data from db with dart, and dynamically pass named params - v1
/*
Carlos Martinez 2021
this is a very little library for confortable use of firestore in dart.
version 1.0
*/
import 'package:cloud_firestore/cloud_firestore.dart';
// class for firestore `where` method, this is a trick
// because Dart doest not support pass dynamically named parameters
@coxato
coxato / mongoSingleton.js
Last active October 5, 2020 15:10
mongodb connection and CRUD singleton
/*
*
* 2020 Carlos Martínez
* follow me https://github.com/carlosEdua
*
*/
const MongoClient = require("mongodb").MongoClient;
const mongoClientOptions = { useNewUrlParser: true, useUnifiedTopology: true };
// mongoDB instance
@pajaydev
pajaydev / js-objects-compare.md
Last active April 5, 2024 01:47
JS Objects : Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

const language = {
  name: 'JavaScript',
  author: 'Brendan Eich'
};

// Inheriting from another object.
Object.setPrototypeOf(language, {createdAt: "Netscape"});
@lukecav
lukecav / functions.php
Last active July 4, 2024 22:22
Disable woocommerce_webhook_deliver_async in WooCommerce
apply_filters( 'woocommerce_webhook_deliver_async', '__return_false' );
@bq1990
bq1990 / gist:595c615970250e97f3ea
Created December 17, 2014 15:55
Supertest authenticate with bearer token
'use strict';
var should = require('should');
var app = require('../../app');
var request = require('supertest')(app);
describe('GET /api/incidents', function() {
it('should require authorization', function(done) {
request
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mikaelbr
mikaelbr / destructuring.js
Last active August 20, 2024 11:27
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@branneman
branneman / better-nodejs-require-paths.md
Last active October 18, 2024 20:29
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions