Skip to content

Instantly share code, notes, and snippets.

View istarkov's full-sized avatar
💭
I need snow, now!

Ivan Starkov istarkov

💭
I need snow, now!
View GitHub Profile
@bmaeser
bmaeser / subtitle-extract.txt
Created September 2, 2011 23:25
extract subtitles from *.mkv-files on osx
lines with $ are commands
### install mkvtoolnix:
$ brew install mkvtoolnix
### list content of the mkv-file:
$ mkvmerge -i mymoviefile.mkv
### what will give you:
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@fukata
fukata / nginx.lb.conf
Created October 25, 2012 05:57
nginx proxy cache gzipped contents
http {
upstream web_backend {
server web01:80;
server web02:80;
}
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache-space:100m max_size=1024m inactive=1h;
proxy_temp_path /var/cache/nginx/tmp;
server {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@wting
wting / nyan.sh
Last active March 5, 2024 00:45
Nyan cat in bash shell.
#!/usr/bin/env bash
NYAN=('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmbmbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmb'
@leon
leon / README.md
Created February 4, 2014 09:49
angularjs $q decorator for spread

Use it like this

$q.all([ promise1, promise2 ]).then($q.spread(function (promise1Result, promise2Result) {

});

@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: