Skip to content

Instantly share code, notes, and snippets.

View izdi's full-sized avatar
🥑

Sergey Keller izdi

🥑
View GitHub Profile
@izdi
izdi / normcore-llm.md
Created August 24, 2023 14:36 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@izdi
izdi / Convert .mov or .MP4 to .gif.md
Created September 22, 2022 16:48 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@izdi
izdi / minimal-analytics-snippet.js
Created December 16, 2018 17:28 — forked from DavidKuennen/minimal-analytics-snippet.js
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@izdi
izdi / timeit.py
Created November 23, 2018 16:13
Performance measurement
import functools
import gc
import itertools
import sys
from timeit import default_timer as _timer
def timeit(_func=None, *, repeat=3, number=1000, file=sys.stdout):
"""Decorator: prints time from best of `repeat` trials.
@izdi
izdi / queries.sql
Created April 26, 2018 12:20 — forked from iconara/queries.sql
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id
@izdi
izdi / mgen.py
Created August 1, 2017 11:08 — forked from bbengfort/mgen.py
Get a random matrix with elements between 0 and 9.
#!/usr/bin/env python
##########################################################################
## Imports
##########################################################################
import sys
import argparse
import traceback
import numpy as np
@izdi
izdi / postgres_queries_and_commands.sql
Created September 20, 2016 08:42 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@izdi
izdi / train.py
Created September 12, 2016 09:28 — forked from ageitgey/train.py
# -*- coding: utf-8 -*-
"""
Based on the tflearn example located here:
https://github.com/tflearn/tflearn/blob/master/examples/images/convnet_cifar10.py
"""
from __future__ import division, print_function, absolute_import
# Import tflearn and some helpers
import tflearn
@izdi
izdi / r_u_a_bird.py
Created September 12, 2016 09:27 — forked from ageitgey/r_u_a_bird.py
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
import scipy
@izdi
izdi / automation.md
Created June 21, 2016 13:49 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go