I hereby claim:
- I am chaitanyagupta on github.
- I am chaitanyagupta (https://keybase.io/chaitanyagupta) on keybase.
- I have a public key ASC2IGaOUZI3T5g9aPkl0_8azN9kb0BGarsb8iQbll54gAo
To claim this, I am signing this object:
// pj_str.c | |
// Some memory tests around pj_str_t | |
// | |
// To compile, | |
// | |
// $ gcc -g -I$PJSIP/pjlib/include -L$PJSIP/pjlib/lib -lpj-i386-apple-darwin12.5.0 -o pj_str pj_str.c | |
// | |
// And then run ./pj_str | |
// | |
// Check memory leaks using valgrind: |
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-17906056-1', { 'userId': '<snipped>','clientId': '<snipped>' }); | |
ga('set', 'dimension1', '<snipped>'); | |
ga('send', 'pageview', '/VPV/LI/Overview/MyView/Dashboard');</script> |
(defun squash-log-newlines () | |
"Squash wrapped log lines back to their original single line format." | |
(interactive) | |
(end-of-line) | |
(let ((search-str "[2010-01") | |
(start-marker (make-marker)) | |
(end-marker (make-marker))) | |
(set-marker start-marker (point)) | |
(search-forward search-str) | |
(set-marker end-marker (- (point) (1+ (length search-str)))) |
var findItem = function(jid, items){ | |
for(var i = 0; i < items.length; ++i){ | |
var item = items[i]; | |
if(item.jid === jid){ | |
return item; | |
} | |
} | |
return null; | |
} |
;;; Usage (percentage (analyze-systems '(a b c d))) => 42.23 | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(when (asdf:find-system :named-readtables nil) | |
(asdf:load-system :named-readtables))) | |
(defun analyze-form (form) | |
(typecase form | |
(symbol | |
(when (eql (symbol-package form) (find-package 'cl)) |
I hereby claim:
To claim this, I am signing this object:
;;; mbox parser in Common Lisp | |
;; needs cl-mime and cl-base64 | |
;; (ql:quickload :cl-mime) | |
;; (ql:quickload :cl-base64) | |
;; | |
;; Example: returns all emails in an mbox (as CL-MIME:MIME objects) | |
;; | |
;; (with-open-file (in #p"/path/to/mbox") | |
;; (let ((p (make-parser :stream in))) | |
;; (loop for mime = (next-mime p) |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
int bind_and_listen (int port, int backlog) { | |
int listen_fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); | |
if (listen_fd == -1) { | |
perror("socket"); |
Monitor tcp connections in a particular process
nettop -m tcp -p <proc-name>
Monitor tcp connetions in a process (delta mode)
nettop -m tcp -p -d