Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorge (Hezi) Cohen hezi

View GitHub Profile
View convcmf.c
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#pragma pack(push, 1)
typedef struct {
char magic[6];
unsigned short iInstrumentBlockOffset;
unsigned short iMusicOffset;
View gxpack.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#pragma pack(push, 1)
/* Library Header */
typedef struct {
View unpcxgx.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// #include <malloc.h>
// #include <windows.h>
#ifdef GCC32HACK
#include "win32gcc.h"
#endif
View borland-debug-info.bt
//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
// Authors: Jorge Cohen <me@jorgecohen.codes>
//
//------------------------------------------------
typedef struct
{
WORD MZSignature <comment="IMAGE_DOS_SIGNATURE = 0x5A4D",format=hex>;
View head-debug.js
var memwatch = require('memwatch-next');
var heapdump = require('heapdump');
memwatch.on('leak', function(info) {
console.error(info);
var file = '/tmp/myapp-' + process.pid + '-' + Date.now() + '.heapsnapshot';
heapdump.writeSnapshot(file, function(err){
if (err) console.error(err);
else console.error('Wrote snapshot: ' + file);
});
View 1.README.md

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
View app.js
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@hezi
hezi / GIPSuperWebViewInit.js
Created Dec 9, 2012
partial GIPSuperWebViewInit.js
View GIPSuperWebViewInit.js
. . .
navigator.googleInternal = {
iframe_: undefined,
isInitialized: false,
init: function() {
if (this.isInitialized) {
return;
}
this.iframe_ = document.createElement('iframe');
@hezi
hezi / HZClassUsingEnum.h
Created Jul 12, 2012
Objective-C Enum-TO-NSString and Vice versa.
View HZClassUsingEnum.h
// Declare enums like so:
#define IMAGE_STATUS(XX) \
XX(kDOImageStatusOK, = 0) \
XX(kDOImageStatusCached, )\
XX(kDOImageStatusRetry, )
DECLARE_ENUM(DOImageStatus, IMAGE_STATUS)