Skip to content

Instantly share code, notes, and snippets.

View tianchaijz's full-sized avatar
🏠
Working from home

tianchaijz tianchaijz

🏠
Working from home
View GitHub Profile
@zenparsing
zenparsing / combinators-with-async-generators.js
Created April 8, 2016 20:57
Combinators with Async Generators
function once(el, event) {
return new Promise((resolve, reject) => {
const handler = e => {
resolve(e);
el.removeEventListener(event, handler);
};
el.addEventListener(event, handler);
});
};
template <typename Left, typename Right>
struct ConcatExpr;
template <typename Left, typename Right>
struct AltExpr;
template <typename SubExpr>
struct RepeatExpr;
template <char ch>
@kiritsuku
kiritsuku / ComplexTcpClient.scala
Last active August 15, 2018 06:11
Complex TCP server and client
import scala.io.StdIn
import scala.util._
import akka.actor._
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.util._
object ComplexTcpClient extends App {
@JeOam
JeOam / SystemTap.md
Last active August 9, 2017 02:13
SystemTap Tips

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
@cloudwu
cloudwu / inject.lua
Last active March 28, 2023 16:33
Inject code with locals and upvalues
local FUNC_TEMP=[[
local $ARGS
return function(...)
$SOURCE
end,
function()
return {$LOCALS}
end
]]
@kwk
kwk / CMakeLists.txt
Created February 9, 2015 13:37
Use boost from Git repo together with CMake External Project
project(regex)
cmake_minimum_required(VERSION 2.8)
# For some external project macros
include(ExternalProject)
# Download boost from git and build regex module
ExternalProject_Add(
@makmanalp
makmanalp / comparison.md
Last active March 14, 2023 14:58
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2024 17:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\