Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@blurymind
blurymind / Revert-Gist.md
Created July 18, 2020 09:23 — forked from eduncan911/Revert-Gist.md
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone [email protected]:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@blurymind
blurymind / service-worker.js
Created June 28, 2020 17:21 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
prepareAnimationStrip(frames) {
let renderer = this.app.renderer;
const rect = new PIXI.Rectangle(
0,
0,
this.tilewidth * frames.length,
this.tileheight
);
var container = new PIXI.Container();
export const getBottomChildren = (scanObject: any, limit: number | null = null, collectedChildren: Array<any> = []) => {
if (limit && collectedChildren.length === limit) return collectedChildren;
if (scanObject.children === null) collectedChildren.push(scanObject);
else scanObject.children.forEach(child => getBottomChildren(child, limit, collectedChildren));
return collectedChildren;
};
export const collectChildrenWithKey = (
@blurymind
blurymind / deleteNodeModules.bat
Last active August 1, 2019 09:43
windows batch script to recursively delete all node_modules folders within a project. Could help when storybook is acting funny
@ECHO OFF
:: This batch file deletes all node_modules subfolders.
TITLE Deleting node_modules folders...
ECHO Scanning, Please wait...
for /d /r . %%d in (node_modules) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"
ECHO done!
PAUSE
@blurymind
blurymind / acejs_bbc
Created July 22, 2019 08:00 — forked from gnysek/acejs_bbc
ACE js bbcode
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var MyNewHighlightRules = function() {
this.$rules = {
"start" : [
@blurymind
blurymind / extractFramesFromDroppedVideo
Created September 15, 2018 12:22
Simple Batch script to extract frames from a video file- uses ffmpeg
@echo off
echo This requires you to install ffmpeg
REM ffmpeg -i file.mov -r 24/1 output%03d.png
REM nxF is for file with ext
for %%F in ("%~1") do SET fileNameExt=%%~nxF
for %%F in ("%~1") do SET fileName=%%~nF
echo file name is: %fileName%
SET ffmpegPath=C:\ffmpeg\bin\ffmpeg.exe
@blurymind
blurymind / threevideodemo.js
Created March 15, 2018 14:26 — forked from ErikPeterson/threevideodemo.js
THREEJS Video Texture Demo
//Set up scene, camera, and renderer
var scene = new THREE.Scene;
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
var renderer = new THREE.CanvasRenderer();
renderer.setClearColor( 0xf0f0f0 );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var video = document.createElement('video');
[('python36.dll',
'D:\\WORK\\PYTHON\\WinPython-64bit-3.6.3.0-CLEAN\\python-3.6.3.amd64\\python36.dll',
'BINARY'),
('VCRUNTIME140.dll',
'D:\\WORK\\PYTHON\\WinPython-64bit-3.6.3.0-CLEAN\\python-3.6.3.amd64\\VCRUNTIME140.dll',
'BINARY'),
('_ssl',
'D:\\WORK\\PYTHON\\WinPython-64bit-3.6.3.0-CLEAN\\python-3.6.3.amd64\\DLLs\\_ssl.pyd',
'EXTENSION'),
('unicodedata',
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; Sun Lotion - Data Entry Application ;;;
;;; Created by Todor Imreorov -- [email protected] ;;;
;;; For Use with SolarVista ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Add, Text, Section x50,Created by Todor Imreorov