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/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@kahlil
kahlil / microblog-import.js
Last active January 1, 2019 08:41
Micro.blog import script
const fs = require('fs');
const { promisify } = require('util');
const matter = require('gray-matter');
const got = require('got');
const queryString = require('query-string');
const readFile = promisify(fs.readFile);
const readDir = promisify(fs.readdir);
(async () => {

Keybase proof

I hereby claim:

  • I am kahlil on github.
  • I am kahlil (https://keybase.io/kahlil) on keybase.
  • I have a public key whose fingerprint is 50A7 8150 2D49 4FA8 F5B1 068D F4F6 F1B6 7F2C F47B

To claim this, I am signing this object:

@kahlil
kahlil / index.js
Last active September 1, 2016 13:51
requirebin sketch
var React = require('react')
var render = require('react-dom').render
var hyperx = require('hyperx')
var hx = hyperx(React.createElement)
var App = React.createClass({
getInitialState: function () { return { n: 0 } },
render: function () {
return hx`<div>
<h1>clicked ${this.state.n} times</h1>
@kahlil
kahlil / JavaScript Quickstart.md
Last active March 25, 2016 14:42
A simple package.json to quickstart and build out any JavaScript project.

JavaScript Quickstart

If you want to quickly try out an idea use this package.json. Just npm install create an index.js file, write ES2015 code if you want and see what it does in the browser by typing npm start on the command line.

As a foundation for a build-out you have xo installed for linting and ava for testing.

import ACTION_CONSTANTS from '../../constant/action-constants';
import Rx from 'rx';
class SomeStore {
constructor(dispatcher) {
'ngInject';
this.dispatcher = dispatcher;
this.someState = false;
this.subject = new Rx.ReplaySubject(1);
import ACTION_CONSTANTS from '../../constant/action-constants';
import Rx from 'rx';
class SomeStore {
constructor(dispatcher) {
'ngInject';
this.dispatcher = dispatcher;
this.someStore$ = this.registerActionHandlers();
}
@kahlil
kahlil / dabblet.css
Created December 25, 2015 00:16
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@kahlil
kahlil / create-from-array.js
Created December 8, 2015 13:21
Observables Basics: Events are basically collections over time.
const coordinates = Rx.Observable.from([
{ x: 12, y: 32 },
{ x: 45, y: 62 },
{ x: 22, y: 33 }
]);
@kahlil
kahlil / cycle-storage-driver.js
Last active November 19, 2015 21:09
How to use @cycle/storage.
// Import Cycle core, the dom driver and the storage driver.
import Cycle from '@cycle/core';
import storageDriver from '@cycle/storage';
import { makeDOMDriver, h } from '@cycle/dom';
function main({DOM, storage}) {
// Create a stream of storage requests:
// 1. we select the desired input field
const storageRequest$ = DOM.select('input')
// 2. We listen to the keypress events.