Skip to content

Instantly share code, notes, and snippets.

View mauricioszabo's full-sized avatar

Maurício Szabo mauricioszabo

View GitHub Profile
@sogaiu
sogaiu / gist:f24bf1b03665688ca7c3f8c42f3a71d7
Last active February 13, 2019 13:44
ideas for detecting which type of clojure (jvm, clr, js) is at remote end of the repl
; idea 1 - works if repl's read configured to support reader conditionals
#?(:clj :clj :cljr :cljr :cljs :cljs)
; idea 2 - may work - note that order is important below
; send this first
; if the result is non-nil, dealing with cljs, don't continue
(resolve '*clojurescript-version*)
; only send the following if the previous result was nil
; if the result is non-nil, dealing with clr, don't continue
@mfikes
mfikes / add-lib.md
Last active May 22, 2020 20:37
add-lib from ClojureScript

Alex Miller's new add-lib capability, hacked into ClojureScript:

deps.edn:

{:deps {org.clojure/clojurescript {:git/url "https://github.com/mfikes/clojurescript"
                                   :sha "4fa9edd736d47b8ef5648b61b199e64ef80735bb"}
        org.clojure/tools.deps.alpha {:git/url "https://github.com/clojure/tools.deps.alpha.git"
                                      :sha "d492e97259c013ba401c5238842cd3445839d020"}}}
@telent
telent / gist:704274
Created November 17, 2010 22:46
Some random notes on Mirah, mostly culled from the mailing list

Stuff in Ruby that is/isn't supported, or is different

=begin / =end

Rib Rdb writes: "The new parser doesn't support this". Use single line comments instead

The object model

The ruby object model is not the same as the java object model. The

@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@shripadk
shripadk / gist:562270
Created September 2, 2010 13:16
Google Closure XPC demo
goog.require('goog.Uri');
goog.require('goog.events');
goog.require('goog.json');
goog.require('goog.net.xpc.CrossPageChannel');
goog.global.initOuter = function(url) {
goog.events.listen(window, 'load', function() { xpcdemo.initOuter(url); });
};
goog.global.initInner = function() {
goog.events.listen(window, 'load', function() { xpcdemo.initInner(); });
@dcparker
dcparker / ftps_implicit.rb
Created March 25, 2009 18:47
ftps_implicit for Ruby
require 'socket'
require 'openssl'
require 'net/ftp'
class Net::FTPS < Net::FTP
end
class Net::FTPS::Implicit < Net::FTP
FTP_PORT = 990