const language = {
name: 'JavaScript',
author: 'Brendan Eich'
};
// Inheriting from another object.
Object.setPrototypeOf(language, {createdAt: "Netscape"});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* 2020 Carlos Martínez | |
* follow me https://github.com/carlosEdua | |
* | |
*/ | |
const MongoClient = require("mongodb").MongoClient; | |
const mongoClientOptions = { useNewUrlParser: true, useUnifiedTopology: true }; | |
// mongoDB instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply_filters( 'woocommerce_webhook_deliver_async', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
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.