Skip to content

Instantly share code, notes, and snippets.

@bfad
bfad / obsidian-web-clipper.js
Last active February 16, 2022 21:18 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@bfad
bfad / keybase.md
Created January 9, 2015 01:55
Keybase Proof

Keybase proof

I hereby claim:

  • I am bfad on github.
  • I am bfad (https://keybase.io/bfad) on keybase.
  • I have a public key whose fingerprint is 6243 14CD 26A8 0FFD 3B38 4FBB 8AB8 DEB7 EA3F 4ADE

To claim this, I am signing this object:

@bfad
bfad / integer-asStringOrd.lasso
Created April 3, 2014 14:56
The [integer->asStringOrd] returns the ordinal format of an integer.
/*
Sample Usage:
1->asStringOrd
// => 1st
*/
define integer->asStringOrd => {
(:11,12,13)->contains(self % 100)?
return self->asString + 'th'
return self->asString + (:'th','st','nd','rd','th','th','th','th','th','th')->get((self % 10) + 1)
@bfad
bfad / regexp-forEachMatch.lasso
Last active August 29, 2015 13:58
The [regexp->forEachMatch] method allows you to iterate over each match in your regular expression to do complex replacements. It also automatically calls the [regexp->appendTail] method at the end that is easy to forget.
/*
Sample Usage:
local(matcher) = regexp(-find=`(?i)[aeiou]`, -input='Whoa, this is heavy!')
#matcher->forEachMatch => {
#1->appendReplacement(string_upperCase(#1->matchString(0)))
}
#matcher->output
// Outputs: WhOA, thIs Is hEAvy!
@bfad
bfad / TEST.lasso
Last active December 21, 2015 10:48
define lspec_testSuite => type {
// Tallying up the test suite
data private suite = array,
private result = string,
private failures = '',
private pendings = ''
// Tally Getters
public suite => .'suite',
result => .'result',
failures => .'failures',
@bfad
bfad / rails_template.rb
Created August 31, 2010 01:15
New Rails Project
# You can run this template using the following command:
# => rails new ProjectName -J -m https://gist.github.com/558360.txt
#
# Or, find the latest Raw URL for the gist and use it. *Example* below:
# => rails new ProjectName -J -m https://gist.github.com/raw/558360/3496b5cceaee8e56a070f54cf8fc94b47bdb1715/rails_template.rb
#
# This rails template does the folowing
# 1) Sets up jQuery to be used instead of Prototype
# 2) Sets up Haml as the default templating engine
# 3) Setups Rspec to be used instead of Test::Unit
http://gitref.org/
Excellent overview and documentation for the most-used commands
http://git-scm.com/
Official git webpage
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
Official git users manual
http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/