Skip to content

Instantly share code, notes, and snippets.

View peko's full-sized avatar

Vladimir Seregin peko

  • https://peko.github.io/about
  • Frankfurt
View GitHub Profile
package main
import (
"bufio"
// "fmt"
"os"
"strings"
)
var storage map[string]string
@peko
peko / test-map.c
Last active November 19, 2015 22:15
#include <stdio.h>
#include <stdlib.h>
#include "khash.h"
KHASH_MAP_INIT_STR(str, char*)
int
main(void)
{
FILE * fp;
storage = {}
file = require('fs').readFileSync('test-data.txt').toString().split("\n");
for l in file
[k,v] = l.split '\t'
storage[k] = v
storage = {}
rl = require('readline').createInterface
input: require('fs').createReadStream('test-data.txt')
rl.on 'line', (l)->
[k,v] = l.split '\t'
# console.log k, v
storage[k] = v
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "bloom.h"
#define STRS 24
// This code needs some additions to struct bloom
// It needs counter of collision, to messure real error:
This file has been truncated, but you can view the full file.
{
"meta": {
"code": 200,
"api_version": "2.0.257",
"issue_date": "20160407"
},
"result": {
"total": 5785,
"items": [
{
@peko
peko / app.iced
Last active April 17, 2016 14:37
Hashtag aggregator for instagram, vk & twitter
pg = require "pg"
hag = require "./hashtag-aggregator"
postgres = "postgres://"
cn = postgres
pc = new pg.Client cn
@peko
peko / irc-telegram.coffee
Last active April 20, 2016 16:17
Irc to telegram and back
irc = require 'irc'
TelegramBot = require 'node-telegram-bot-api'
token = '' # INSERT YOUR BOT TOKEN HERE
tele = new TelegramBot token, polling: true
channel = #INSERT YOUR IRC CHANNEL HERE "#mytestchannel"
chat_id = #INSERT YOUR TELEGRAM GROUP ID HERE -123456789
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="apng-canvas.min.js"></script>
</head>
<body>
<canvas id="cvs" with="512px" height="512px">
<script type="text/javascript">
@peko
peko / start-tiddly.sh
Created May 29, 2016 23:48
Tiddly wki launch
#!/bin/bash
tiddlywiki wiki --init server
cd wiki
pm2 start --name tiddly-wiki /usr/local/lib/node_modules/tiddlywiki/tiddlywiki.js -- --server 8080 $:/core/save/all text/plain text/html user pass 0.0.0.0