Skip to content

Instantly share code, notes, and snippets.

View dcrystalj's full-sized avatar

Tomaz dcrystalj

View GitHub Profile
v=(
"https://fast.wistia.com/embed/medias/s9wjrade3.m3u8 2-intro"
"https://fast.wistia.com/embed/medias/hu7ykwiqh.m3u8?start_position=1408 2.1-adding-dependencies"
"https://fast.wistia.com/embed/medias/gigpykg5t.m3u8 2.2-module-mirrors"
"https://fast.wistia.com/embed/medias/ult4p3810.m3u8 2.3-checksum-database"
"https://fast.wistia.com/embed/medias/kbfxk63kh.m3u8?start_position=327 2.4-vendoring"
"https://fast.wistia.com/embed/medias/gglksai2r.m3u8 2.5-mvs-algorithm"
)
for i in $v
WITH city AS (
SELECT user_id, name, moved_on,
row_number() over (partition by user_id order by moved_on desc) city_freshness
FROM location
),
latest_location AS (SELECT * FROM city where city_freshness=1)
SELECT
"user".id,
CREATE SCHEMA subquery;
USE subquery;
CREATE TABLE IF NOT EXISTS "user" (
id INT,
name VARCHAR (50)
);
CREATE TABLE IF NOT EXISTS "location" (
id INT,
CREATE DATABASE subquery
\c subquery
CREATE TABLE IF NOT EXISTS "user" (
id INT PRIMARY KEY,
name VARCHAR (50) NOT NULL
);
CREATE TABLE IF NOT EXISTS "location" (
SELECT
"user".id,
"user".name,
(
SELECT l.name
FROM location l
WHERE location.user_id=l.user_id
ORDER BY l.moved_on DESC
LIMIT 1
) current_location,
@dcrystalj
dcrystalj / promise queue
Created April 25, 2019 15:09
simple promise queue framework
export const PromiseQueue = function() {
let defered = Promise.resolve();
return {
push(fn) {
defered = defered.then(fn, fn);
return this;
}
};
};
@dcrystalj
dcrystalj / testing-vue-tree
Last active November 11, 2018 08:12
Testing vue tree
TESTING VUE:
education
Testing Vue.js Applications https://www.manning.com/books/testing-vue-js-applications
vue-test-utils docs https://vue-test-utils.vuejs.org/
vue docs https://vuejs.org/v2/guide/unit-testing.html
vuex docs https://vuex.vuejs.org/guide/testing.html
testing
@dcrystalj
dcrystalj / launch.json
Last active September 10, 2018 20:40
debugging
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
@dcrystalj
dcrystalj / tasks.json
Last active September 10, 2018 20:39
g++ build
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build & run",
"type": "shell",
"command": "g++ program.cpp -std=c++14 -o program.out && time ./program < in.txt",
"group": {
@dcrystalj
dcrystalj / cloudSettings
Last active December 24, 2017 08:27
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-12-24T08:27:36.000Z","extensionVersion":"v2.8.7"}