Skip to content

Instantly share code, notes, and snippets.

View binarycleric's full-sized avatar
💢

Jon Daniel binarycleric

💢
View GitHub Profile
@binarycleric
binarycleric / gist:5730032
Last active December 18, 2015 05:08
ruby array esplosion!!!!!
>> array = {}; array[100000000000000000] = 1
=> 1
>> array = []; array[100000000000000000] = 1
irb(16739,0x7fff7de08960) malloc: *** mmap(size=800000000000004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
irb(16739,0x7fff7de08960) malloc: *** mmap(size=800000000000004096) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
# sort the files for easier viewing
--sort-files
# all-lower-case is case-insensitive, otherwise it's case sensitive
--smart-case
# show the context of the found item
--context
# Other file types we want to search
--type-set=haml=.haml
--type-set=sass=.sass
--type-set=scss=.scss
(function(e) {
"use strict";
function t() {
this.data = {}
}
function n() {
this.listeners = new t
}
function r(e) {

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@binarycleric
binarycleric / gist:4567731
Last active December 11, 2015 07:38
exploit attempt?
<!DOCTYPE HTML>
<html>
<head>
<title>Top Diet</title>
<script>
function aobi6q(s) {
var key=96;
var str = decodeURIComponent(s);
var xored = "";
@binarycleric
binarycleric / gist:3908169
Created October 17, 2012 21:03
ZSH Config
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="derp"
# Example aliases
@binarycleric
binarycleric / gist:3908062
Created October 17, 2012 20:45
tmux config (October 2012)
# screw the mouse
set-window-option -g mode-mouse off
# scrollback history
set -g history-limit 5000
# "I' == current window index
# 'H' == Hostname
# 'F' == current window flag
# 'P' == current pane index
@binarycleric
binarycleric / gist:3880379
Created October 12, 2012 17:27
PHP Bug #55247 Investigation
<?php
class Test{
public static function __callStatic($method, $arguments)
{
echo $method . PHP_EOL;
}
public function __call($method, $arguments)
{
echo $method . PHP_EOL;
}
@binarycleric
binarycleric / gist:3880369
Created October 12, 2012 17:26
PHP Bug #55021 Investigation
<?php
/*
* I looked into this for a bit and I must say I was a bit confused
* until the answer smacked me in the face.
*
* The 'fn3' isn't doing what you think it's doing. Upon glancing at
* the code it may appear that $this->a['first'] is having the value
* 'foo' appended to it (which doesn't make sense because
* $this->a['first'] is a string, not an array).
et guifont=Consolas:h18
set textwidth=80
set tabstop=2
set shiftwidth=2
set expandtab
set spell
set nocompatible
filetype off