Skip to content

Instantly share code, notes, and snippets.

@christofdamian
christofdamian / pocket-reader-org-roam-capture.el
Created January 8, 2021 16:32
elisp to create org-roam entries from pocket-reader
(defun pocket-reader-org-roam-capture ()
(interactive)
(pocket-reader--at-marked-or-current-items
(when-let (
(resolved_title (pocket-reader--get-property 'resolved_title))
(resolved_url (pocket-reader--get-property 'resolved_url))
(item_id (pocket-reader--get-property 'item_id))
(time_added (pocket-reader--get-property 'time_added))
(excerpt (pocket-reader--get-property 'excerpt))
(tags (combine-and-quote-strings (pocket-reader--get-property 'tags)))
;;;;;;;;;;;;;;;;;;;
;; Collections in Clojure
;;;;;;;;;;;;;;;;;;;
;; Distinctive characteristics
;;;;;;;;;;;;;;;;;;;
;; * They are mainly used in terms of abstractions, not the details of concrete implementations.
;; * They are immutable and persistent.
;;;;;;;;;;;;;;;;;;;
@jhbabon
jhbabon / bundle_config_example.md
Last active August 29, 2015 14:00
Pass configuration options to gems installed with bundler

For example, pass a config option to libv8 gem

$ bundle config --local build.libv8 --with-system-v8
$ cat .bundle/config
---
BUNDLE_BUILD__LIBV8: "--with-system-v8"

Now libv8 will be installed almost in the same way that gem does:

# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "username/vod-45-new-feature"
# it automatically adds the prefix "[VOD-45]" to commit
# messages.
#
# Example
# =======
#
# git checkout -b bob/vod-45-some-cool-feature
@rgo
rgo / gist:1714364
Created February 1, 2012 01:20
MySQL backup (saving engine used for table creation)
# I'm using --create-options to get all the info about table creation (i.e. engine=InnoDB)
$ mysqldump -u foobar -p --single-transaction --create-options <database> > file.sql
@vitobotta
vitobotta / Importing posts from Wordpress into Jekyll.rb
Created March 26, 2011 22:50
The script I used to import posts from my Wordpress blog into a new Jekyll one.
%w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g}
require File.join(File.dirname(__FILE__), "downmark_it")
module WordPress
def self.import(database, user, password, table_prefix = "wp", host = 'localhost')
db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8')
%w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder}
#!/usr/bin/env ruby
# encoding: UTF-8
#
# LearnRubyByExample:
#
# Ruby is a highly expressive programming language.
# Testing software is an expressive way to communicate how it works.
#
# In the middle of a night awake for allergy and insomnia, and some days after the 1st _why day,
# I've tried to combine Ruby and testing to help teaching ruby with some goals in mind:
@aitor
aitor / wadus.rb
Created July 2, 2010 10:53 — forked from porras/wadus.rb
def wadus(wadus = nil, options = {})
puts "wadus = #{wadus.inspect}"
puts "options = #{options.inspect}"
end
wadus
# wadus = nil
# options = {}
# OK