The following block renders as ruby even though no language is specified:
def method
puts "a method!"
end
:~$ This text is always clobbered by the YARD parser
{ | |
"load_extensions": { | |
"integration": true, | |
"toolmetrics": true | |
}, | |
"_": "https://codemirror.net/doc/manual.html", | |
"MarkdownCell": { | |
"cm_config": { | |
} | |
}, |
Jupyter.notification_area.get_widget("notebook").set_message("Extension loaded!"); |
Jupyter.notebook.kernel.execute("puts 'hello world'", { | |
iopub : { | |
output : function(response) { | |
console.log(response); | |
} | |
} | |
}); |
require 'zlib' | |
require 'yard' | |
require 'tmpdir' | |
require 'stringio' | |
require 'fileutils' | |
require 'archive/tar/minitar' | |
io = StringIO.new File.read('sequel-4.32.0.gem') | |
catch :finished do |
The following block renders as ruby even though no language is specified:
def method
puts "a method!"
end
:~$ This text is always clobbered by the YARD parser
# https://porkrind.org/missives/calling-applescript-from-ruby/ | |
def osascript(script) | |
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten | |
end | |
# http://stackoverflow.com/questions/5292204/macosx-get-foremost-window-title | |
osascript <<-END | |
global frontApp, frontAppName, windowTitle | |
set windowTitle to "" |
{ | |
"*" : [ | |
["exec", "echo 'exec works!'"], | |
["eval", "puts 'eval works!'"] | |
], | |
"iruby" : [ | |
["eval", "puts 'gems work!'"], | |
["gem", "metaid"] | |
], | |
"metaid": [ |
def cropPicture(picture): | |
smallPic = makeEmptyPicture(186,100) | |
smallX = 0 | |
smallY = 0 | |
for x in range(59,244): | |
smallX +=1 | |
smallY = 0 | |
for y in range(25,125): | |
pixel = getPixel(picture,x,y) | |
smallPicPixl = getPixel(smallPic,smallX,smallY) |
require 'socket' | |
class TCPSocket | |
class << self | |
def new host, *args, &block | |
socket = super host, *args, &block | |
# check whitelist, set indicator | |
socket.instance_variable_set :@mypki, true # or false | |
# return socket | |
socket |
require 'json' | |
require 'watir' | |
require 'seconds' | |
if ARGS.empty? | |
warn 'Please provide the Facebook user number and query string that will appear in every post (first name usually works)' | |
exit | |
end | |
b = Watir::Browser.new |