Skip to content

Instantly share code, notes, and snippets.

@hasssan
hasssan / vscode-vimkeybinding
Created June 3, 2024 11:04
Keybinding for vscode vim
{
"vim.normalModeKeyBindings": [],
"vim.visualModeKeyBindings": [
{
"before": [
">"
],
"commands": [
"editor.action.indentLines"
]
@hasssan
hasssan / daily_template.md
Created September 6, 2021 17:38 — forked from hdnl/daily_template.md
Template to faciliate taking daily notes in Markdown, featuring start and end day reflections, schedule, and work log

Start-of-Day Reflections

I am grateful for...

What would make today great?

@hasssan
hasssan / jiraToDendronTaskPage.js
Last active August 9, 2022 05:40 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) or Tasks - Usual for posting links to resources in README.md files
javascript: (function () {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData('Text', text);
} else if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
var textarea = document.createElement('textarea');
textarea.textContent = text;
textarea.style.position = 'fixed';
/* Prevent scrolling to bottom of page in MS Edge.*/
@hasssan
hasssan / remove-node-modules.sh
Created November 17, 2019 11:32
Remove all node_modules file
# source https://stackoverflow.com/questions/46037728/find-all-node-modules-directories
# https://rtmccormick.com/2018/01/10/clear-node-modules-folders-recursively-mac-linux/
find . -name "node_modules" -prune -exec rm -rf '{}' +
@hasssan
hasssan / generate-ssh-key.sh
Created November 20, 2018 16:32 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@hasssan
hasssan / addlicense.sh
Last active September 12, 2018 09:38 — forked from Elemecca/addlicense.sh
Prepends a license notice to a set of files.
#!/bin/bash
#
# addlicense.sh - prepends a license notice to a set of files
#
# Originally written by Sam Hanes <sam@maltera.com>.
# To the extent possible under law, the author has waived all copyright
# and related or neighboring rights in this work, which was originally
# published in the United States. Attribution is appreciated but not
# required. The complete legal text of the release is available at
# http://creativecommons.org/publicdomain/zero/1.0/
@hasssan
hasssan / index.html
Last active January 6, 2021 13:12 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<meta charset="UTF-8">
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 20px; }
@media (min-width: 768px){
body{ padding-top: 150px; }
}
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
@hasssan
hasssan / TimeAgo.jsx
Created July 4, 2017 09:35
Timeago Moment
// source https://github.com/nmn/react-timeago/issues/85#issuecomment-306959939
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
const makeRelative = (dateMoment) => {
if (!dateMoment.isValid()) { return ''; }
return dateMoment.fromNow();
};
@hasssan
hasssan / formdata.js
Created March 21, 2017 04:56
log FormData
// source stackoverflow
const form = new window.FormData()
for (let pair of form.entries()) {
console.log(`${pair[0]}: ${pair[1]}`)
}
@hasssan
hasssan / convert-ls-to-js.sh
Last active November 8, 2016 06:12
convert .ls to .js
#!/bin/bash
# compile to js
#find $1 -type f -name '*.ls' -exec lsc -b -c {} \;
# fix some extension from lsc compiler
#for loca in `git ls-files --others --exclude-standard`; do
# if [[ $loca != *.js ]] && [[ $loca != *.sh ]]; then
# mv "$loca" "$loca.js"
# fi