Skip to content

Instantly share code, notes, and snippets.

video = tf.keras.layers.Input(shape=(None, 150, 150, 3))
cnn = tf.keras.applications.InceptionV3(
weights='imagenet',
include_top = False,
pool='avg')
cnn.trainable = False
encoded_frames = tf.keras.layers.TimeDistributed(cnn)(video)
encoded_vid = tf.layers.LSTM(256)(encoded_frames)
question = tf.keras.layers.Input(shape=(100), dtype='int32')
@chulman444
chulman444 / readJson.jsx
Created December 13, 2017 18:58
ExtendScript read JSON file.
# I needed this for my own AfterEffects Script.
// Use absolute path for the JSON file.
path = '/d/path/to/your/json/file.json'
// Get file object
file = File(path);
// open it before reading.
file.open('r');
@chulman444
chulman444 / extract_full_array_from_json.py
Created December 14, 2017 20:13
Typical code for typical work. I just forget things so why not use GIST
import json, sys
from functools import reduce
inputfilename = sys.argv[1]
outputfilename = sys.argv[2]
file = open(inputfilename, mode='r', encoding='utf-8')
raw = file.read()
file.close()
raw_json = json.loads(raw)
@chulman444
chulman444 / Lazy_load_less_fany.html
Created February 4, 2018 22:49
Found [this][1]
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!-- LAZY LOAD -->
<img onerror="
var w = window;
var lazy = function(){
@chulman444
chulman444 / Lazy_load_less_fany.html
Created February 4, 2018 22:49
Found [this][1]
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!-- LAZY LOAD -->
<img onerror="
var w = window;
var lazy = function(){
@chulman444
chulman444 / Lazy_load_less_fany.html
Last active February 4, 2018 22:54
Trying out lazy load without src attribute from the first place. Original code: https://codepen.io/marvin52/post/hack-lazy-load
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<script type="text/javascript">
function lazyLoad() {
var w = window;
var lazy = function(){
var imgs = document.querySelectorAll('[lazy]');
@chulman444
chulman444 / After_effects_script_logger.js
Created February 20, 2018 03:22
After effects script logger. I forget how to use it ... after few months LUL
function LogFile(path) {
this.file = File(path)
}
LogFile.prototype.write = function(line) {
this.file.open('a');
this.file.write(line + "\n");
this.file.close()
}
@chulman444
chulman444 / .vimrc
Last active March 5, 2018 11:09
vimrc. I keep forgetting my configs
:set nopaste "Fixes weird indentation when pasting"
"Didn't know 'paste' mode exists. do `:set paste` manually"
"when you have to paste and back to `:set nopaste` after you are done"
"Else, the 'paste' mode, bottom reading `--INSERT (paste)--` will ignore other settings here"
"Refer to `:help paste`"
:set tabstop=4 "Default is 8 and is too much for me"
:set expandtab "I prefer space"
:set shiftwidth=4 "Set to 4 spaces for indenting with `Shift + >>` in view mode"
:set autoindent "The above doesn't 'autoindent'"
:set splitright "Why the hell the default would open the new file on the LEFT???"

From this gist ... I'm trying to link to the inline anchor.

Click me

As this comment says, all has to be in lower case, and no space between # and the first character.

Getting original file from a new or patched file from a diff file.

Instead of diff orig new > diff0 and keeping diff0, and original file,

diff new orig > diff0 then keep the new and diff0 and discard the original file.

Didn't take very long to think of this, but I may forget again.

Having this "I have to come up with a solution" feeling stresses me. ARCHIVED!