Skip to content

Instantly share code, notes, and snippets.

Working from …

Andrey M amka

Working from …
View GitHub Profile
View csv_reader.dart
import 'dart:io';
import 'package:csv_reading/csv_reading.dart' as csv_reading;
void main(List<String> arguments) {
if (arguments.isEmpty) {
print("Usage: csv_reading path/to.csv\n");
final path = arguments[0];
amka / telegram.desktop
Last active October 23, 2021 18:18
Contract to share files vie Telegram using elementary OS Contractor
View telegram.desktop
[Contractor Entry]
Name=Share via Telegram
Name[ru]=Поделиться в Telegram
Exec=sh -c "flatpak run org.telegram.desktop -sendpath %f && notify-send 'File sent' '%f successfully sent via Telegram'"
amka / markdown.plist
Created July 10, 2018 06:44
Markdown file associations
View markdown.plist
amka / Info.plist
Created July 10, 2018 06:03
File associations
View Info.plist
<string>XML File</string>
amka /
Last active November 28, 2016 19:02
Simple app to count lines in file in different language.
package me.meamka;
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class LinesCount {
def get_chunk(sequence, chunk_size=100, limit=None):
count = 0
offset = 0
length = len(sequence)
if not limit:
limit = length
while count < limit and offset < length:
View new File.js
function getFileObject (fileObject, callback) {
var blob = null;
var xhr = new XMLHttpRequest();"GET", fileObject.path);
xhr.responseType = "blob";
// Process onload event: create new File object and call callback function.
xhr.onload = () => {
blob = xhr.response; =;
def process_chunk(*items):
def process_count(count):
print 'Count %d' % count
def chunked(iters, size):
amka / named
Created April 1, 2016 09:26
Hackerrank namedtuple challenge
View named
from collections import namedtuple
n = input()
Mark = namedtuple('Mark', raw_input().strip())
print round(sum([float(m.MARKS) for m in [Mark(*map(lambda x: x.strip(), raw_input().strip().split())) for i in xrange(n)]]) / n, 2)
amka /
Last active February 26, 2016 08:52
class Solution(object):
def trap(self, height):
:type height: List[int]
:rtype: int
water = 0
height_len = len(height)
if height_len < 3:
return water