Skip to content

Instantly share code, notes, and snippets.

Sneaky Pepper Chilli v2.0

Ingredients

  1. One red onion
  2. One red bell pepper (green is ok if red is unavailable)
  3. One celery stalk
  4. One carrot
  5. One jalepeno
  6. 3 pounds of ground beef
  7. One 29 ounce can of tomato sauce
@edubkendo
edubkendo / RubyNext.tmLanguage
Created August 10, 2013 03:58
A better ruby syntax highlighter for sublime text. Combines the ruby bundle with ST, recent updates to the textmate bundle, and a tmLanguage file called "Experimental Ruby".
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>
TODO: unresolved issues
text:
@edubkendo
edubkendo / gist:e22ba79289ebec490f25
Created August 28, 2014 05:21
Elixir sigil cheatsheet

The letter determines the sigil’s type:

  • ~C a character list with no escaping or interpolation
  • ~c a character list, escaped and interpolated just like a single quoted string ~R a regular expression with no escaping or interpolation
  • ~r a regular expression, escaped and interpolated
  • ~S string with no escaping or interpolation
  • ~s string, escaped and interpolated just like a double quoted string
  • ~W a list of whitespace-delimited words, with no escaping or interpolation ~w a list of whitespace-delimited words, with escaping and interpolation
```
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f6ad31614c4, pid=6325, tid=140096765916928
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b83) (build 1.8.0-ea-b83)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b24 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x964c4] envz_strip+0x214

I have an object node. Each node can have an array of child_nodes:

node 

#=> (RootNode, (BlockNode, (NewlineNode, (DefnNode:foo, (MethodNameNode:foo), (ArgsNode, (ListNode, (ArgumentNode:bar))), (NewlineNode, (LocalVarNode:bar)))), (NewlineNode, (FCallNode:foo, (ArrayNode, (StrNode)))), (NewlineNode, (DefnNode:quux, (MethodNameNode:quux), (ArgsNode), (NewlineNode, (FCallNode:puts, (ArrayNode, (FCallNode:foo, (ArrayNode, (StrNode))))))))))

node.child_nodes
@edubkendo
edubkendo / atom_opal.md
Last active April 19, 2018 05:09
Writing Atom Plugins in Opal (Ruby)

I want to write plugins for Atom's editor in Ruby. Opal makes this possible. Atom is one of several projects in recent times to combine Chromium with Node.js for a desktop app. While it utilizes chromium for it's gui, and boasts "[e]very Atom window is essentially a locally-rendered web page", writing Atom plugins is more like writing a server-side node.js app than a typical single-page client-side app (albeit with really awesome integration with Chrome Devtools). Opal development, on the other hand, has to-date been focused primarily on the browser use-case.

Because of this, I had to make a choice between using the opal-node package from npm, using Opal via Ruby w/ a compile step, or packaging up opal-parser.js, including it with the app, and writing in compilation on the fly. Each choice came with compromises. Using opal-node would have been easiest, just create a top level index.coffee that required opal-node, and then require in your ruby

def my_method
return alt_val unless some_statement
calc_return_val
end
def some_method
if some_statement
calc_return_val
else
alt_return_val
end
end
@edubkendo
edubkendo / ctags_subl_coffee.md
Created June 9, 2012 15:11
Ctags, Sublime Text, Coffeescript

Ctags with Sublime Text and Coffeescript

Get Ctags

Step one is to install Exuberant Ctags on your system. For those on an Ubuntu system, this is as simple as:

sudo apt-get install ctags

Get the Sublime Text Plug-in

{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",