Skip to content

Instantly share code, notes, and snippets.

View lotas's full-sized avatar
🏠
Working from home

Yarik lotas

🏠
Working from home
View GitHub Profile
{
"VCALENDAR": [
{
"VERSION": "2.0",
"PRODID": "-//f1timing v1.0//EN",
"NAME": "Formula One Official Calendar",
"X-WR-CALNAME": "Formula One Official Calendar",
"VEVENT": [
{
"UID": "f1cal48@formula1.com",
@lotas
lotas / kurento-crash.trace
Last active March 17, 2016 12:02
Kurento media server 6.4.1 segfault
--- stack trace ---
#0 0x00007fc243a50cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
resultvar = 0
pid = 14973
selftid = 18597
#1 0x00007fc243a540d8 in __GI_abort () at abort.c:89
save_stage = 2
act = {__sigaction_handler = {sa_handler = 0x7fc2240d8840, sa_sigaction = 0x7fc2240d8840}, sa_mask = {__val = {2, 18628, 140472386274647, 5, 0, 0, 140472335076648, 140471980504576, 18628, 11, 140472386303253, 0, 140472372118602, 0, 140471980499680, 6}}, sa_flags = 0, sa_restorer = 0x1}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00000000005188f1 in safe_abort () at /opt/kurento/kurento-media-server/server/death_handler.cpp:299
#!/bin/bash
# Git post checkout hook.
# Reminds you of South migration changes when switching branches.
# Can be useful when you are when you are testing out a branch from
# someone else that requires migrations.
# Put the file in .git/hooks/post-checkout
PREVIOUS_HEAD=$1
NEW_HEAD=$2
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
# Username/password example
# DAEMON_ARGS="-b -t -a \"*.*.*.*\" -e /var/log/transmission/transmission.log"
# No username/password, but limited to 192.168.1.*
# DAEMON_ARGS="-b -T -a \"192.168.1.*\" -e /var/log/transmission/transmission.log"
INTERFACE=ppp0
if ifconfig $INTERFACE >>/dev/null 2>&1; then
BIND_ADDR="`/sbin/ifconfig $INTERFACE | awk '$1 == \"inet\" {print $2}' | awk -F: '{print $2}'`"
@lotas
lotas / fetch.js
Last active December 28, 2015 02:49
Fetch & parse radio song details, save in mongodb database To generate some stats and remember which song played a while ago ;)
var http = require('http'),
xml2js = require('xml2js'),
MongoClient = require('mongodb').MongoClient;
var reqOptions = {
host: "streamdb4web.securenetsystems.net",
port: 80,
path: "/player_status_update/KMYZ.xml?randStr=",
method: "GET"
};
@lotas
lotas / directive.js
Created October 25, 2013 11:43
Autocomplete with directive stacking
autocomplete.directive('typeahead', ['$compile', 'AutocompleteService', function ($compile, AutocompleteService) {
return {
restrict: 'A',
priority: 999,
link: function ($scope, elm, attrs) {
$scope.getItems = function (filter, type, autocompletItems) {
var fn = AutocompleteService.getLookupFunction(type, autocompletItems);
return fn(filter);
}
}
@lotas
lotas / autocomplete.js
Created October 25, 2013 08:03
autocomplete.js angular bootstrap-ui
autocomplete.directive('suggest', ['$compile', 'AutocompleteService', function ($compile, AutocompleteService) {
var cnt = 0;
return {
require: '',
restrict: 'A',
replace: true,
transclude: true,
template: '<input ng-transclude type="text" autocomplete="off" typeahead="item for item in items" />',
compile: function (elm, attrs) {
@lotas
lotas / p_sha1.php
Created October 24, 2013 21:51
p-sha1 in php
<?php
$secret = base64_decode('kAIthWJeZ3UoS4k6qLIbfA==');
$label = base64_decode('L3JLyhzv0VTomcnzcDjoAhaMNCk=');
$seed = base64_decode('yP9lu4OUF1ah534Re/ZfcQ==');
$newSeed = $label . $seed; // concat as strings
$length = 16;
// $p_sha1
@lotas
lotas / fill_table.py
Created June 14, 2013 10:57
>python fill_table.py database table_name 20 [ Really dump script to fill the void of mysql tables. Will create 20 records with in *database.table_name* table with random data (depending on column type) ]
import re
import sys
import random
import string
import numpy as np
import MySQLdb
import MySQLdb.cursors
DB_HOST = "localhost"
DB_USER = "root"