Skip to content

Instantly share code, notes, and snippets.

Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
@codinronan
codinronan / InputMask.html
Last active October 26, 2018 23:44 — forked from JoeMeeks/InputMask.html
Custom Ionic 2 & 3 Input Mask Directive
<ion-input type="tel" pattern="\d*" placeholder="(xxx) xxx-xxxx" mask="(***) ***-****" [(ngModel)]="phone" name="phone"></ion-input>
<ion-input type="tel" pattern="\d*" placeholder="xxx-xx-xxxx" mask="***-**-****" [(ngModel)]="ssn" name="ssn"></ion-input>
@codinronan
codinronan / braintree.d.ts
Created December 15, 2017 07:38 — forked from stwiname/braintree.d.ts
Typescript definition file for Braintree node module
//TODO update objects to show optional parameters
//TODO expand on Function parameters
//TODO add enum types
//TODO add error types
declare module Braintree {
/**********************
* Errors *
@codinronan
codinronan / countries.json
Created February 2, 2018 10:04 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@codinronan
codinronan / timestamp_version_bump.js
Created February 18, 2018 00:22
Apache Cordova build hook to auto bump iOS CFBundleVersion and Android versionCode
#!/usr/bin/env node
var fs = require("fs"),
path = require("path");
var rootdir = process.argv[2];
if (rootdir) {
module.exports = function(context) {
@codinronan
codinronan / custom-error.js
Created April 21, 2019 04:39 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@codinronan
codinronan / some.component.html
Created May 13, 2019 06:11 — forked from ValentinFunk/some.component.html
Angular 2 Waypoints using ng2-scrollspy
<div scrollSpy>
<div [waypoint]="i" *ngFor="let i of [1,2,3,4,5,6,7,8]">
{{ i }}
</div>
</div>
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: content-box, border-box;
}
@codinronan
codinronan / useDimensions.js
Created July 18, 2019 03:22 — forked from EduVencovsky/useDimensions.js
React Native Hook for Dimensions
import { useState, useEffect } from 'react'
import { Dimensions } from 'react-native'
const useDimensions = getter => {
const [dimensions, setDimensions] = useState(Dimensions.get(getter))
useEffect(() => {
const widthHandler = d => setDimensions(d[getter])
Dimensions.addEventListener('change', widthHandler)
return () => Dimensions.removeEventListener('change', widthHandler)
})
@codinronan
codinronan / 01_install_yarn.config
Created February 9, 2020 23:33 — forked from cooperka/01_install_yarn.config
AWS Elastic Beanstalk - Replace npm with yarn
# .ebextensions/01_install_yarn.config
files:
'/opt/elasticbeanstalk/hooks/appdeploy/pre/49install_yarn.sh' :
mode: '000755'
owner: root
group: root
content: |
#!/usr/bin/env bash
set -euxo pipefail