Skip to content

Instantly share code, notes, and snippets.

@misfo
misfo / symbol_literals.rb
Created July 8, 2011 20:05
valid Symbol literal characters in Ruby
$ ruby -v
ruby 1.9.2p136 (2010-12-25)
$ ruby symbol_literals.rb
valid as first char:
@$_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
valid as middle char:
_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
valid as end char:
!_=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
@misfo
misfo / phoenix-global.js
Created January 22, 2018 18:38
phoenix.js 1.3 compiled to a global var
var Phoenix =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
Index: ext/openssl/ossl_pkey_ec.c
===================================================================
--- ext/openssl/ossl_pkey_ec.c (revision 44351)
+++ ext/openssl/ossl_pkey_ec.c (working copy)
@@ -757,8 +757,10 @@
method = EC_GFp_mont_method();
} else if (id == s_GFp_nist) {
method = EC_GFp_nist_method();
+#if !defined(OPENSSL_NO_EC2M)
} else if (id == s_GF2m_simple) {
didUpdateAttrs() { console.log('flash-container didUpdateAttrs', arguments); },
didReceiveAttrs() { console.log('flash-container didReceiveAttrs', arguments); },
willUpdate() { console.log('flash-container willUpdate', arguments); },
willRender() { console.log('flash-container willRender', arguments); },
didUpdate() { console.log('flash-container didUpdate', arguments); },
didRender() { console.log('flash-container didRender', arguments); },
@misfo
misfo / gist:6829835
Created October 4, 2013 17:47
rake error when running in abstract_type repo
$ bundle exec rake --trace spec
rake aborted!
wrong number of arguments (2 for 0..1)
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/yardstick-0.9.6/lib/yardstick/rake/measurement.rb:52:in `initialize'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/devtools-58d3075f896e/tasks/metrics/yardstick.rake:24:in `new'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/devtools-58d3075f896e/tasks/metrics/yardstick.rake:24:in `block (2 levels) in <top (required)>'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/task_manager.rb:196:in `in_namespace'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/dsl_definition.rb:104:in `namespace'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/devtools-58d3075f896e/tasks/metrics/yardstick.rake:4:in `block in <top (required)>'
/Users/a912955/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/r
module Something
def somethings_method
end
class SomethingsConstant
end
end
extend Something
def self.some_func
end
# now we can call this at the top-level
p some_func #=> nil
# without polluting Object
p Object.new.respond_to?(:some_func, true) #=> false
def some_object_polluting_func
module MyApp
module Deeply
module Nested
module Namespace
class Useful
end
class AlsoUseful
end
module CallInstance
def call(*args, &block)
new(*args, &block).call
end
alias_method :[], :call
end
p RUBY_VERSION #=> "2.0.0"
require 'adamantium'
require 'adamantium/version' # not required by default, oops!
p Adamantium::VERSION #=> "0.1.0"
class Something
include Adamantium
end