Skip to content

Instantly share code, notes, and snippets.

View ox's full-sized avatar
👹
what is this, AIM?

Artem Titoulenko ox

👹
what is this, AIM?
View GitHub Profile
/* Light Backgrounds */
.near-black { color: #111111 }
.bg-washed-yellow { background-color: #FFFCEB }
.dark-gray { color: #333333 }
.bg-near-white { background-color: #F4F4F4 }
.dark-gray { color: #333333 }
.bg-light-red { background-color: #FF725C }
in ~/code/sr.ht/meta.sr.ht on master
$ python ./run.py | tee -a /tmp/run-log
Traceback (most recent call last):
File "./run.py", line 3, in <module>
from metasrht.app import app
File "/Users/artem/code/sr.ht/meta.sr.ht/metasrht/app.py", line 55, in <module>
app = MetaApp()
File "/Users/artem/code/sr.ht/meta.sr.ht/metasrht/app.py", line 22, in __init__
from metasrht.blueprints.billing import billing
File "/Users/artem/code/sr.ht/meta.sr.ht/metasrht/blueprints/billing.py", line 14, in <module>
@ox
ox / watcher.go
Last active December 23, 2018 20:54
A fsnotify-powered watcher for Go that supports adding listeners
package main
import (
"log"
"github.com/fsnotify/fsnotify"
)
type CB func(Event)
type Event struct {
@ox
ox / inv-deps.js
Created December 21, 2018 18:00
Inverted dep tree generator. Nodes higher up on the tree are dependencies of their child nodes.
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const {spawnSync} = require('child_process');
const deps = {};
const dependedBy = {};
function getDependencies(packageJsonFile) {
assert(packageJsonFile);
@ox
ox / web-screenshotter.js
Created December 10, 2018 18:57
Tool using `puppeteer-core` to take full screenshots of a given url.
const Promise = require('bluebird');
const puppeteer = require('puppeteer-core');
const step = 3000;
async function Screenshot(page, y = 0) {
const toRemove = ['header', '.back-to-top-button', '.ad', '.bxc'];
await Promise.mapSeries(toRemove, (cls) => {
return page.$$eval(cls, elements => elements.forEach(elem => elem.remove()))
.catch(() => {});
@ox
ox / server.go
Last active November 28, 2018 01:02
Using libv8 with Go to recreate Cloudflare Edge Workers
package main
import (
"fmt"
"log"
"time"
"net/http"
"context"
"encoding/json"
"github.com/gorilla/mux"
diff --git a/src/Fbx2Raw.cpp b/src/Fbx2Raw.cpp
index a192d8e..df2afa8 100644
--- a/src/Fbx2Raw.cpp
+++ b/src/Fbx2Raw.cpp
@@ -596,12 +596,14 @@ public:
const unsigned int blendShapeIx,
const unsigned int channelIx,
const FbxDouble deformPercent,
- const std::vector<TargetShape> &targetShapes
+ const std::vector<TargetShape> &targetShapes,
(def cordMax 4)
(defrecord Cord [data weight left right])
(defn print-cord
([root] (print-cord root 0))
([root level]
(println (apply str (repeat level " ")) (get root :data "") (get root :weight ""))
(when-let [left (:left root)] (print-cord left (+ 2 level)))
(when-let [right (:right root)] (print-cord right (+ 2 level)))))
@ox
ox / changed-files-after-build
Last active December 29, 2017 05:39
Comparison of log outputs when installing bsb-native in npm locally `"bs-platform": "file:../bs-native"` vs as a remote `"bs-platform": "bsansouci/bsb-native"`
$ git st
M lib/bsb
D vendor/ninja-build/ninja.darwin
M vendor/ocaml/bin/ocaml
M vendor/ocaml/bin/ocamlc
M vendor/ocaml/bin/ocamlc.opt
M vendor/ocaml/bin/ocamlcp
M vendor/ocaml/bin/ocamldep
M vendor/ocaml/bin/ocamldep.opt
M vendor/ocaml/bin/ocamllex
@ox
ox / basic_gear1_prog_index.m3u8
Last active October 26, 2017 15:03
Basic Stream's gear1 index playlist
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:9.97667,
fileSequence0.ts
#EXTINF:9.97667,
fileSequence1.ts
#EXTINF:9.97667,