Skip to content

Instantly share code, notes, and snippets.

View danielwangksu's full-sized avatar

Daniel Wang danielwangksu

  • San Francisco Bay Area, CA
View GitHub Profile
@somdoron
somdoron / example.c
Last active May 31, 2017 16:29
polling on multiple sockets
void* ctx = zmq_ctx_new();
void* client = zmq_socket(ctx, ZMQ_CLIENT);
// creating new pollfd, pollfd is per thread.
void* pollfd = zmq_pollfd_new();
// associate pollfd with client, you can associate multiple pollfd with one socket for multi threading
zmq_add_pollfd(client, pollfd);
zmq_pollitem_t items[] {
@wb14123
wb14123 / Makefile
Created February 2, 2013 01:48
How Kernel's Makefile Specify Output Directory
ifeq ($(KBUILD_SRC),)
ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
endif
ifneq ($(KBUILD_OUTPUT),)
$(filter-out submake $(CURDIR)/Makefile, $(MAKECMDGOALS)): sub-make
@:
sub-make:
@helton
helton / styles.less
Last active May 15, 2018 05:53
Atom Configuration for JavaScript (JSX) with Fira Code as Font Ligature
//Custom configuration
atom-text-editor {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-family: "Operator Mono";
font-size: 16px;
font-weight: 500;
line-height: 1.5;
}
@ibanez270dx
ibanez270dx / apps.sh
Created October 26, 2015 01:23
Fresh OSX setup
#!/bin/sh
# First install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cask brew-cask
# Applications
brew cask install 1password
brew cask install anvil
brew cask install atom
Wow. I've now read the whole book and much of the supporting code. I'm not a fan, and recommend against relying on it. Here's a laundry list of concerns:
* The teaching method the book uses is badly flawed. The book's strategy is to start simple and build to complexity, which makes sense if you're teaching algebra but not if you're teaching heart surgery. The result is that each chapter culminates with the implementation of a system that is grievously insecure. Little warning is given of this, apart from allusions to future chapters improving the system. For instance, Chapter 2 closes with a chat system that uses AES-CBC without an authenticator.
* The book is full of idiosyncratic recommendations. For instance, AES-CBC requires a padding scheme. There is a standard padding scheme. The book purports to present it, but instead of PKCS7, it presents 80h+00h..00h.
* At one point about 1/3rd of the way through the book, it suggests using a SHA256 hash of the plaintext as an authenticator for a message. This r
@zzl0
zzl0 / coders.txt
Last active August 8, 2018 20:45
Name Description
Peter Norvig Director of Research at Google and author of the standard text on AI.
Alan Kay Inventor of Smalltalk. Coined the term "object-oriented programming".
Guy Steele Co-inventor of Scheme and part of the Common Lisp Gang of Five. Currently working on Fortress.
Donald Knuth Author of The Art of Computer Programming and TeX
Gerald Jay Sussman Co-creator of Scheme and co-author of The Structure And Interpretation of Computer Programs.
John McCarthy Invented Lisp
John Carmack Founder of id Software; lead programmer of Doom, Quake, and others.
Dennis Ritchie Invented C and contributed to development of UNIX
Joe Armstrong Inventor of Erlang

Usage

export MACOS_UNIVERSAL=no
pip install capstone # or something depends on capstone

Fore more detail...

Refer to this issue: capstone-engine/capstone#1235

@lavaldi
lavaldi / tweaks-sublime-italic-operator-mono.md
Created March 16, 2017 02:02
Operator Mono & Sublime Text 3 themes
  1. Install Package Resource Viewer.
  2. In package control window select ‘Package Resource Viewer: Open Resource’.
  3. Scroll down until you find the option: ‘Color Scheme — Default’ (or your theme with color scheme .tmTheme) and select it.
  4. Add the following
<!-- Operator Tweaks -->
  <dict>
    <key>name</key>
 Italic HTML attribute names
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "config.h"
#include "test.h"
#if HAVE_OPENSSL_SHA_H