Skip to content

Instantly share code, notes, and snippets.

View SergXIIIth's full-sized avatar

Sergey Makridenkov SergXIIIth

View GitHub Profile
@SergXIIIth
SergXIIIth / probe.c
Created November 6, 2015 08:16
Take metadata from video
// gcc src/decoder.c -lavcodec -lavformat
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
int main(int argc, char *argv[]) {
char *filename = "/home/msa/Videos/Cowspiracy.2014.1080p-EGN.mkv";
av_register_all();
require "./sev/*"
module Sev
puts "Hello"
@[Link("m")]
@[Link("avcodec")]
@[Link("avformat")]
lib AvFormat
fun av_register_all
@SergXIIIth
SergXIIIth / gist:ee705b2e0798d2ca0950
Created October 27, 2015 16:29
Crystal perfomance
$ crystal build src/hello.cr --release
$ time ./hello
Hello world
real 0m0.003s
user 0m0.000s
sys 0m0.004s
$ time ruby hello.rb
<object id="videoplayer354" type="application/x-shockwave-flash" data="http://localhost:3000/player/uppod.swf" width="500" height="375">
<param name="bgcolor" value="#3333" />
<param name="allowFullScreen" value="true" />
<param name="allowScriptAccess" value="always" />
<param name="movie" value="http://localhost:3000/player/uppod.swf" />
<param name="flashvars" value="comment=Video&amp;st=http://localhost:3000/player/st/video205-524.txt&amp;file=http://localhost:3000/video.mp4" />
</object>
@SergXIIIth
SergXIIIth / header.sass
Created September 13, 2014 05:19
Sass with @extend - no additional class in HTML
.header
@extend .container
.brand
float: left
span
+text-hide
.links
@SergXIIIth
SergXIIIth / task_1.cc
Last active August 29, 2015 13:57
Lab_2
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int period, interest;
float interest_in_period, amount, income;
@SergXIIIth
SergXIIIth / task_1.cc
Last active August 29, 2015 13:57
Lab_1
#include <iostream>
#include <conio.h> // В этой библиотеке "живет" - getch();
/*
Исходные данные
---------------
Сумма вклада
Срок вклада, в месяцах
*/
class Object
def blank?
self.nil?
end
def present?
!blank?
end
end
@SergXIIIth
SergXIIIth / compile_asserts.rb
Last active December 24, 2015 17:39
Compile assets (Coffee, Sass, Serenadejs) in pure Ruby
require 'rubygems'
require 'bundler/setup'
require 'coffee-script'
require 'sass'
require 'fileutils'
require 'execjs'
require 'multi_json'
support_pattern = '{**/*.serenade,**/*.coffee,**/*.sass}'
@SergXIIIth
SergXIIIth / gist:6426527
Last active December 22, 2015 05:49
Jasmine sleep function. Helpful to wait until DOM events handled.
window.sleep = (ms, and_runs) ->
flag = false
runs ->
setTimeout ->
flag = true
, ms
waitsFor ->
flag