Skip to content

Instantly share code, notes, and snippets.

View lambdaX's full-sized avatar

Islam Ali lambdaX

View GitHub Profile

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

@vojtasvoboda
vojtasvoboda / .gitlab-ci.yml
Last active December 5, 2020 16:29
GitLab CI FTP deploy with mwienk/docker-lftp docker image
stages:
- test
- deploy
cache:
paths:
- vendor
# test job
test:
@hyamamoto
hyamamoto / calculating_floats.py
Last active September 19, 2016 10:27
Calculating float values in Python with builtins.
#!/usr/bin/env python
def p(t, v):
print('{:<40}-> {}'.format(t, v))
p('.1 + .1 + .1', .1 + .1 + .1)
p('round(.1 + .1 + .1, 10)', round(.1 + .1 + .1, 10))
p('(0.1).as_integer_ratio()', (0.1).as_integer_ratio())
@olymk2
olymk2 / 3Drending.py
Created January 26, 2015 21:38
example gl error 1282 modification to example code
from kivy.app import App
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.resources import resource_find
from kivy.graphics.transformation import Matrix
from kivy.graphics.opengl import *
from kivy.graphics import *
from objloader import ObjFile
@rozifus
rozifus / Python SimpleHTTPServer with SSL
Last active October 9, 2022 22:40
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 11, 2024 14:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@booherbg
booherbg / gist:f812c9145d157d8945b2
Last active February 25, 2022 23:44
Cross compiling a simple go server for windows

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

@emad-elsaid
emad-elsaid / server.rb
Created February 20, 2014 11:42
create ruby server in 7 lines of code
require 'webrick'
Port = 3000
Directory = Dir::pwd
WEBrick::HTTPServer.new(
Port: Port,
DocumentRoot: Directory
).start
from kivy.app import App
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.graphics.texture import Texture
from kivy.graphics import RenderContext
from itertools import chain
shader_distort_samples = '''
$HEADER$
@chilts
chilts / alexa.js
Created October 30, 2013 09:27
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;