Skip to content

Instantly share code, notes, and snippets.

View baringji's full-sized avatar

Jofil Inoc Baring baringji

View GitHub Profile
@baringji
baringji / youtube-url.php
Last active November 12, 2015 00:44 — forked from simplethemes/youtube-url.php
Extracts YouTube video ID from various URL structures
<?php
$url = array (
'http://youtu.be/dQw4w9WgXcA',
'http://www.youtube.com/embed/dQw4w9WgXcB',
'http://www.youtube.com/watch?v=dQw4w9WgXcC',
'http://www.youtube.com/?v=dQw4w9WgXcD',
'http://www.youtube.com/v/dQw4w9WgXcE',
'http://www.youtube.com/e/dQw4w9WgXcF',
'http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcG',
@baringji
baringji / keymap.cson
Created November 16, 2015 22:58
Use atom emmit plugin on php files.
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@baringji
baringji / config.cson
Last active January 7, 2016 02:51
Atom config file.
"*":
"exception-reporting":
userId: "c3514caf-02ee-6b5d-90c4-e9c15ec1bd3d"
welcome:
showOnStartup: false
core:
ignoredNames: [
".idea"
".git"
".hg"
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@baringji
baringji / reEdition.js
Created December 11, 2021 14:05
HashLips Art Engine ReEdition
const fs = require("fs");
const path = require("path");
const { createCanvas, loadImage } = require("canvas");
const basePath = process.cwd();
const buildDir = `${basePath}/build/json`;
const inputDir = `${basePath}/build/images`;
const metaDir = `${basePath}/build/meta`;
const editionDir = `${basePath}/build/editions`;
const {
format,