Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Talker AlexTalker

  • Russia
View GitHub Profile
@AlexTalker
AlexTalker / helloworld.pyx
Created Mar 5, 2020
Direct I/O in Python with Cython
View helloworld.pyx
from libc.stdlib cimport malloc, free
from libc.stdio cimport *
from posix.unistd cimport *
from posix.stdlib cimport *
from posix.fcntl cimport *
def test_cython(path):
cdef int ret
cdef int stdout_save, dev_null
cdef int O_DIRECT = 040000
View PKGBUILD
# Maintainer: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor:
pkgname=marker-git
pkgver=2018.03.09.r86.g2d701156
pkgrel=1
pkgdesc='Markdown editor for linux made with Gtk+-3.0'
arch=('x86_64')
url='https://github.com/fabiocolacio/Marker'
license=('GPL3')
@AlexTalker
AlexTalker / mock_open.pl
Created Apr 7, 2017 — forked from ernix/mock_open.pl
Mock(override) built-in `open` function in perl.
View mock_open.pl
#
# http://perldoc.perl.org/CORE.html#OVERRIDING-CORE-FUNCTIONS
# > To override a built-in globally (that is, in all namespaces), you need to
# > import your function into the CORE::GLOBAL pseudo-namespace at compile
# > time:
# >
# > BEGIN {
# > *CORE::GLOBAL::hex = sub {
# > # ... your code here
# > };
View upload-to-repo.py
#!/usr/bin/python
from sys import argv
from os import listdir, symlink, unlink
from os.path import isfile, join, getctime
from fnmatch import fnmatch
from datetime import datetime, date
from subprocess import run, Popen, PIPE
from ftpush import ftpush
from parse_db import DBReader
View parse_db.py
#!/usr/bin/python
import tarfile
from sys import argv
from os.path import dirname, basename
class TarFileWithDirs(tarfile.TarFile):
def __init__(self, *args, **kwargs):
super(TarFileWithDirs, self).__init__(*args, **kwargs)
self._dirs = {}
for o in self:
View ftpush.py
#!/usr/bin/python
from sys import argv
from os.path import basename
from ftplib import FTP, error_perm, error_reply
import configparser
import netrc
def _parse_config(filename):
config = configparser.ConfigParser({
'port': '0',
View playground.rs
use std::sync::mpsc::{channel, Sender};
use std::sync::Mutex;
use std::thread;
#[derive(Debug)]
enum Message { A, B }
struct Request;
struct Response;
struct IronError;
View keybase.md

Keybase proof

I hereby claim:

  • I am alextalker on github.
  • I am alextalker (https://keybase.io/alextalker) on keybase.
  • I have a public key whose fingerprint is 3B76 C91D B5DB 1F42 AAE3 BA13 6F05 5519 8EEC 55E0

To claim this, I am signing this object:

View games_controller.rb
class GamesController < ApplicationController
Vertical = 'v'
Horizontal = 'h'
def new
@game = Game.new
@game.field = new_field
@player = auth
@game.vscore = 0 # default scores
@game.hscore = 0
@game.way = Vertical
View Numbers.java
public class Numbers{
public static void main(String[] args){
String[] numbers = {"один", "два", "три", "четыре", "пять", "шесть", "семь", "восемь", "девять"};
for(String arg: args){
for(String number: numbers){
System.out.print(arg+ " " + number + ",");
}
System.out.print("\n");
}
You can’t perform that action at this time.