Skip to content

Instantly share code, notes, and snippets.

View kahlil's full-sized avatar

Kahlil Lechelt kahlil

View GitHub Profile
@kahlil
kahlil / obsidian-web-clipper.js
Created October 5, 2023 12:42 — 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/" */
@kahlil
kahlil / slackbot.md
Last active September 21, 2015 12:34 — forked from boennemann/slackbot.md

guys, dudes, bros

I think you mean team...

I think you mean squad..

I think you mean gang...

I think you mean pals...

@kahlil
kahlil / introrx.md
Last active August 29, 2015 14:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
{
"installed_packages":
[
"Alignment",
"Base16 Color Schemes",
"ColorPicker",
"GitGutter",
"HTML-CSS-JS Prettify",
"InactivePanes",
"MaxPane",

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

  • plugins should only do one thing and do them well. Your task shouldn't concat files that's why we have grunt-contrib-concat. Your task shouldn't minify CSS, that's what eg. grunt-csso is for.
  • don't bloat with uneeded options. pick sane defaults.
  • should be fully tested (this should be enforced! we really don't want people using untested plugins).
  • search the plugin list before creating one. what you want to create is probably already created and all you're doing is making it harder for users to find one.
  • don't use the prototyped colors properties like, ''.green. This will be deprecated in the future. Use a sane coloring lib like chalk instead.
  • readme:
    • should have a good intro
    • travis badge
    • have examples
  • describe all options with types and defaults
var gulp = require('gulp');
var gutil = require('gulp-util');
var express = require('express');
var path = require('path');
var tinylr = require('tiny-lr');
var createServers = function(port, lrport) {
var lr = tinylr();
lr.listen(lrport, function() {
gutil.log('LR Listening on', lrport);

DalekJS - UI testing an der Front

Das testen von Webseiten und Webapps ist die unrühmliche Bastard unserer Zeit. Nachdem wir dieses Biest namens 'Unit testing' gezähmt haben, ist es jetzt an der Zeit, unsere Frontlinien an eine andere Front zu verlagern. Dieses Mal geht es um euer UI. Und nein, wir penetrieren nicht unseren alten Alliierten Selenium und wir kämpfen auch nicht in den Ruby Steppen von Watir, nein meine Freunde, dieses mal ist es an JavaScript unsere Bugs ein für alle mal zu besiegen.

#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done