Skip to content

Instantly share code, notes, and snippets.

View jemc's full-sized avatar

Joe Eli McIlvain jemc

  • TheoremOne
  • Cascadia
View GitHub Profile
@jemc
jemc / myco_innoculate_profile.txt
Created March 16, 2015 01:24
Myco inoculate command profiler output
$ env RBXOPT=-Xprofile beta/bin/myco inoculate gamma
Thread 1: total running time: 318.041755872s
% cumulative self self total
time seconds seconds calls ms/call ms/call name
------------------------------------------------------------
16.02 113.63 86.85 4556901 0.02 0.02 Myco.find_constant_bucket_in_module
4.76 316.69 25.83 2166219 0.01 0.15 Array#each
4.09 23.57 22.19 10600526 0.00 0.00 Array#[]
@jemc
jemc / hg.ex
Created March 9, 2015 06:04
elixir mix hg deps
defmodule Mix.SCM.Mercurial do
@behaviour Mix.SCM
@moduledoc false
def fetchable? do
true
end
def format(opts) do
opts[:hg]
require 'ffi'
require 'benchmark'
module LibC
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :malloc, [:size_t], :pointer
attach_function :free, [:pointer], :void
end

Start weechat if you haven't already:

$ weechat

open up browser and go to: https://irc.gitter.im/ retrieve your /PASS

In weecaht run (thanks to raine):

@jemc
jemc / my_library_function.c
Last active August 29, 2015 14:09
Shell bindings for C functions - an example
#include <my_library.h>
int
main (int argc, char *argv[])
{
// Capture stdout file descriptor and position
int orig_stdout_fd;
fpos_t orig_stdout_pos;
fflush (stdout);
def load
@block_environment || (
@compiled_code || (
@generator || (
@ast || (
@string || (
make_string )
make_ast )
make_generator )
make_compiled_code )
@jemc
jemc / Dockerfile
Last active August 29, 2015 14:04
Rubinius Dockerfile
FROM buildpack-deps
# Make a user, group, and home folder
RUN useradd user -g users -d /home/user -m
# Install build and test dependencies for rubinius.
# The ruby installed here is only for building and will be purged later.
RUN apt-get update && apt-get install -y llvm clang ruby ruby-dev bison procps libedit-dev
RUN gem install bundler --no-document
import QtQuick 2.1
Item {
id: root
Item {
id: a
property var prop: console.log("a.prop property defined")
@jemc
jemc / BigButton.qml
Last active August 5, 2023 09:26
Big Button example in QML using SVG and native layers
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0
import QtGraphicalEffects 1.0
Item {
height: 200
width: 200