Skip to content

Instantly share code, notes, and snippets.

@awinograd
awinograd / gist:2493797
Created April 25, 2012 21:51
EE47 Lab 3 - Analog Input Code
/*
Analog Input
Demonstrates analog input by reading an analog sensor on analog pin 0 and
turning on and off a light emitting diode(LED) connected to digital pin 13.
The amount of time the LED will be on and off depends on
the value obtained by analogRead().
The circuit:
* Potentiometer attached to analog input 0
* center pin of the potentiometer to the analog pin
Reading symbols from /home/awinograd/hhvm314/usr/local/bin/hhvm...done.
[New LWP 10100]
[New LWP 17575]
[New LWP 10014]
[New LWP 9035]
[New LWP 10101]
[New LWP 10099]
[New LWP 8674]
[New LWP 9038]
$1 = {<HPHP::AtomicCountable> = {m_count = {<std::__atomic_base<int>> = {_M_i = 0}, <No data fields>}}, static MethodCreateHook = 0x0, m_nextClass = {m_s = 0}, m_extra = {
m_p = 0x962d060 <HPHP::default_ptr<HPHP::Class::ExtraData>::s_default>, static s_default = {m_traitAliases = std::vector of length 0, capacity 0,
m_usedTraits = std::vector of length 0, capacity 0, m_traitsBeginIdx = 0, m_traitsEndIdx = 0, m_instanceCtor = {m_s = 0}, m_instanceDtor = {m_s = 0},
m_builtinODTailSize = 0,
m_scopedClones = {<std::unordered_map<unsigned long, HPHP::AtomicSharedPtrImpl<HPHP::Class, true>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, HPHP::AtomicSharedPtrImpl<HPHP::Class, true> > > >> = std::unordered_map with 0 elements, <No data fields>}, m_nativeDataInfo = 0x0}}, m_requirements = {
m_map = {m_mask = 0, m_extra = 0, m_table = 0x0}}, m_declInterfaces = std::unique_ptr<HPHP::AtomicSharedPtrImpl<HPHP::Class, true>> containing 0x0,
(gdb) walkstk
#0 {inline frame} @ 0x7f6c0368c5f7: raise()
#1 {inline frame} @ 0x7f6c0368c5f7: abort()
#2 0x7f6bdabf6430 @ 0x7f6c0368c5f7: HPHP::bt_handler() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/base/crash-reporter.cpp:43
#3 {inline frame} @ 0x7f6c08c48100: __restore_rt()
#4 0x7f6bdabf6a00 @ 0x7f6c08c48100: HPHP::Func::validate() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/vm/func-inl.h:73
#5 0x7f6bdabf6a30 @ 0x056636d7: HPHP::Func::fromFuncId() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/vm/func.cpp:357
#6 0x7f6bdabf6a50 @ 0x05728433: HPHP::SrcKey::func() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/vm/srckey-inl.h:120
#7 0x7f6bdabf6cc0 @ 0x061ad17a: HPHP::jit::TransRec::print() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/vm/jit/trans-rec.cpp:146
#8 0x7f6bdabf6da0 @ 0x05f4f1eb: HPHP::jit::MCGenerator::dumpTCData() at /home/awinograd/build_hhvm/hhvm/hphp/runtime/vm/jit/mc-generator.cpp:2216
@awinograd
awinograd / .vimrc
Last active April 16, 2017 21:18
vimrc for prettier
autocmd FileType javascript set formatprg=prettier\ --stdin\ --single-quote\ --trailing-comma\ es5
autocmd FileType javascript.jsx set formatprg=prettier\ --stdin\ --single-quote\ --trailing-comma\ es5
nnoremap <silent> <leader>p gggqG<CR>
" I decided to disable running prettier on save b/c of how
" it loses the cursor position and instead just use `<leader>p` occasionally
" That said, here are the commands I used for auto-prettier on save
" autocmd BufWritePre *.js exe "normal! gggqG\<C-o>\<C-o>"
" autocmd BufWritePre *.jsx exe "normal! gggqG\<C-o>\<C-o>"
@awinograd
awinograd / gist:4699980
Last active January 30, 2018 22:54
cvim file for opening links from better_error and RailsPanel in vim on ubuntu.
#! /usr/bin/env ruby
# Modified from : http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu
# NOTE: This opens with a link to the mvim protocol for compatibility with RailsPanel
# goes to /usr/local/bin/cvim
require 'uri'
require 'cgi'
full_path = ARGV[0]
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
# RSpec matcher to spec delegations.
# Forked from https://gist.github.com/ssimeonov/5942729 with fixes
# for arity + custom prefix.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:name).to(:author).with_prefix(:any) } # post.any_name
# it { should delegate(:month).to(:created_at) }
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions