- https://gist.github.com/elabs-dev/41c27fdb0a007ad4cac6
- https://gist.github.com/shreeve/bffc05490347e8b62575 - FFI version of binding_of_caller
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
# RESTful API | |
# | |
# +--------+-------------------+---------+---------+----------+-----------+ | |
# | METHOD PATH | ACTION | PAYLOAD | TEMPLATE | REDIRECT | | |
# + -------+-------------------+---------+---------+----------+-----------| | |
# | GET | /orders | index | | index | | | |
# | GET | /orders/new | new | | edit | | | |
# | GET | /orders/4;edit | edit | | edit | | | |
# | GET | /orders/4 | show | | show | | | |
# + -------+-------------------+---------+---------+----------+-----------+ |
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 bash | |
watch=/tmp/watch | |
ready=/tmp/ready | |
rm -f $watch $ready | |
mkfifo $watch | |
# reap all on exit | |
trap "exit" INT TERM |
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 ruby | |
# ============================================================================= | |
# Quick proof-of-concept of an FFI-based binding_of_caller (no compiling!) | |
# | |
# Author: Steve Shreeve <[email protected]> | |
# Basis: binding_of_caller and ffi gems | |
# Date: 28 May 2015 | |
# | |
# Legal: MIT 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
# See https://gist.github.com/nanki/1336545 | |
require 'ffi' | |
module FFI::Ruby | |
class Value | |
class << self | |
extend ::FFI::Library | |
ffi_lib 'ruby' |
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 ruby | |
# ============================================================================= | |
# UPDATE as of June 15, 2015: See the bindings gem at: | |
# | |
# https://rubygems.org/gems/bindings | |
# ============================================================================= | |
# ============================================================================= | |
# Quick proof-of-concept of an Fiddle-based binding_of_caller (no compiling!) |
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
FROM ubuntu-debootstrap:14.04 | |
# Nodejs needed for ruby asset pipeline | |
RUN apt-get update -y \ | |
&& apt-get install -y \ | |
curl \ | |
libpq-dev \ | |
&& curl -sSL https://deb.nodesource.com/setup_0.12 | bash - \ | |
&& apt-get install -y nodejs \ | |
&& apt-get autoremove -y \ |
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/ruby -E binary | |
# alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder" | |
apps = {} | |
uses = {} | |
text = %x{`locate lsregister` -dump} | |
rows = text.split('-' * 80); rows.shift |
I hereby claim:
- I am shreeve on github.
- I am shreeve (https://keybase.io/shreeve) on keybase.
- I have a public key ASBI8x-VoitCK6fVsyz0tNSu4A-NsuCh6ri6I1-p1t0gXAo
To claim this, I am signing this object:
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
{ ServiceProvider } = require '@adonisjs/fold' | |
AdonisMongoose = require 'mongoose' | |
module.exports = class MongooseProvider extends ServiceProvider | |
register: -> | |
@app.singleton 'Adonis/Addons/AdonisMongoose', => | |
Config = @app.use 'Adonis/Src/Config' | |
mongoHost = Config.get 'mongo.host', '127.0.0.1' | |
mongoPort = Config.get 'mongo.port', '27017' | |
mongoDb = Config.get 'mongo.db' , 'test' |
OlderNewer