Skip to content

Instantly share code, notes, and snippets.

View baringji's full-sized avatar

Jofil Inoc Baring baringji

View GitHub Profile
@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,
# 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 / 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"
@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 / 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 / designer.html
Last active August 29, 2015 14:27
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<?php
/**
* ACF Layout
* @version 1.0 | November 12th 2013
* @author Beau Charman | http://twitter.com/beaucharman
* @link https://gist.github.com/beaucharman/7181406
* @license MIT license
*
* Logical layout automation for Advanced Custom Fields and it's Flexible Content Field add on.
@baringji
baringji / www.data.group.md
Last active August 29, 2015 14:03
Adding username to www-data group

sudo chown -R www-data:www-data [directory]

sudo usermod -a -G www-data username

@baringji
baringji / pg.terminate.md
Created May 14, 2014 01:13
Disconnect database connections in PostgreSQL 9.2+.

select pg_terminate_backend(pid) from pg_stat_activity where datname = [database name];

@baringji
baringji / ffmpeg.avconv.split.md
Last active August 29, 2015 14:01
Split video using ffmpeg or avconv via terminal.

ffmpeg -acodec copy -vcodec copy -ss START -t LENGTH -i ORIGINALFILE OUTPUTFILE

avconv -c:v copy -c:a copy -ss START -t LENGTH -i ORIGINALFILE OUTPUTFILE