Skip to content

Instantly share code, notes, and snippets.

@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
@robschmuecker
robschmuecker / README.md
Last active March 28, 2025 14:54
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@coderberry
coderberry / chrome-cheat-sheet.md
Last active March 10, 2023 13:56
Chrome Canary Console Cheat Sheet
var get = Ember.get, set = Ember.set, doc = document;
var FastSelectComponent = Ember.Component.extend({
items: null,
valuePath: 'value',
labelPath: 'label',
value: null,
selected: null,
tagName: 'select',
@rxaviers
rxaviers / gist:7360908
Last active May 9, 2025 19:13
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
N_ASSIGNMENTS=100
N_USERS=500
def grade_submission_sql_inserts(assignment,student,grade)
"(#{assignment.id}, #{student.id}, #{grade}, true, 'graded', '#{Time.zone.now.iso8601}')"
end
def grade_submission_sql(assignments,students)
students_sql = assignments.map do |assignment|
students.map do |student|
N_ASSIGNMENTS=100
N_USERS=500
begin
account = Account.default
account.transaction do
course = account.courses.create! name: "Big Gradebook"
e = course.enroll_teacher(User.find(1))
@cmatheson
cmatheson / toggle-class-cache.sh
Last active December 22, 2015 08:09
toggle rails class caching in canvas
function toggle-class-cache() {
cfg=config/environments/development-local.rb
if grep -q config.cache_classes $cfg; then
sed -i '
/config.cache_classes/ s/true/false/
t
s/false/true/' \
config/environments/development-local.rb
else
echo "config.cache_classes = false" > $cfg
def mvim
edit_interactively 'mvim -f -c "set filetype=ruby"'
end
class Object
def send_chain(meths)
result = self
meths.each do |m|
return nil if result == nil
if result.respond_to?(m)