This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; The code of SICP Exercise 2.64, but rewritten to use define-values instead of let. | |
;; http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.64 | |
(struct tree (entry left right) #:transparent) | |
(define EMPTY-TREE '()) | |
;; list->tree: (listof X) -> tree | |
;; Given an ordered list of elements, constructs the balanced binary tree. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; A term sheet is a light-weight, casual version of a contract. :) | |
;; | |
;; Seriously, `define/termsheet' takes the same form as | |
;; `define/contract', but uses the contract predicates as simple | |
;; checks. As a result, this runs much faster -- e.g. ~200x faster -- | |
;; than a normal, chaperoned wrapped procedure. | |
;; | |
;; In other words it gives the declarative convenience of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GLOBAL CONFIGURATIONS | |
# ------------------------------------------------------------------- | |
# See https://github.com/jigish/slate/wiki/Global-Configs | |
config defaultToCurrentScreen true | |
config secondsBeforeRepeat 0.4 | |
config secondsBetweenRepeat 0.1 | |
config keyboardLayout "qwerty" | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Really simple Winston Logstash UDP Logger | |
var dgram = require('dgram'), | |
util = require('util'), | |
os = require('os'), | |
winston = require('winston'); | |
var LogstashUDP = module.exports = function (options) { | |
winston.Transport.call(this, options); | |
options = options || {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To use msm_acdb explot we need to work 4 steps. | |
1. Find how to run command with root or system previlege | |
2. Get offset for registers to setup | |
3. Choose proper code in kernel image | |
4. Setup parameters in acdb.c | |
1. Find how to run command with root or system previlege | |
Do it your self. :-P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -u | |
# Setup architectures, library name and other vars + cleanup from previous runs | |
ARCHS=("armv7" "armv7s" "i386") | |
SDKS=("iphoneos" "iphoneos" "macosx") | |
LIB_NAME="libevent-2.0.21-stable" | |
TEMP_DIR="$(pwd)/tmp" | |
TEMP_LIB_PATH="$(pwd)/tmp/${LIB_NAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
Copyright (c) 2013 CommonsWare, LLC | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
use this file except in compliance with the License. You may obtain a copy | |
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required | |
by applicable law or agreed to in writing, software distributed under the | |
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
OF ANY KIND, either express or implied. See the License for the specific | |
language governing permissions and limitations under the License. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jf.InstrumentationTest; | |
import com.google.common.collect.Lists; | |
import org.jf.dexlib2.DexFileFactory; | |
import org.jf.dexlib2.Opcode; | |
import org.jf.dexlib2.builder.MutableMethodImplementation; | |
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x; | |
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c; | |
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c; | |
import org.jf.dexlib2.iface.ClassDef; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Simple utility to disassemble a raw bytecode file using Capstone. | |
# | |
# -jduck | |
# | |
import argparse | |
import capstone | |
import struct |