Skip to content

Instantly share code, notes, and snippets.


Queensferry queensferryme

Block or report user

Report or block queensferryme

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
queensferryme / producer-consumer.c
Created Oct 28, 2019
Multithreading producer-consumer model implemented with pthread library
View producer-consumer.c
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int buffer[BUFSIZ], head = 0, tail = 0;
pthread_t producer, consumer;
pthread_cond_t notempty, notfull;
pthread_mutex_t lock;
queensferryme / egestream.h
Last active Jun 3, 2019
Input stream implementation for Easy Graphics Engine (
View egestream.h
#pragma once
#include <functional>
#include <graphics.h>
#include <sstream>
#include <string.h>
#include <string>
namespace ege {
queensferryme /
Last active Feb 25, 2019
A simple implementation of Factory Pattern in language python
#!/usr/bin/env python
class UIFactory:
def __init__(self, **builders): = builders
def createMenu(self):
def createText(self):
queensferryme /
Last active Feb 15, 2019
Crawling, analyzing & visualizing #WanderingEarth comments on
#!/usr/bin/env python
import json
import os
from collections import Counter, defaultdict
import jieba.analyse
from pyecharts import Bar, Line, WordCloud
queensferryme /
Last active May 14, 2019
A simple implementation of Pub/Sub Pattern in language python
#!/usr/bin/env python
from collections import defaultdict
class Intermedia:
channels = defaultdict(dict)
def broadcast(cls, channel, msg):
'''broadcast a message to specific subscribers'''
for name, callback in cls.channels[channel].items():
queensferryme /
Last active Feb 8, 2019
Email automatic templating & sending implemented with Python
#!/usr/bin/env python
from csv import DictReader
from email.encoders import encode_base64
from email.header import Header
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from os.path import split, splitext
You can’t perform that action at this time.