Skip to content

Instantly share code, notes, and snippets.

View binyamin's full-sized avatar
🎓
(I'm a) Work In Progress

Binyamin Aron Green binyamin

🎓
(I'm a) Work In Progress
View GitHub Profile
@binyamin
binyamin / mongoUtils.js
Created April 5, 2020 16:27
Mongo DB Utils
const mongoClient = require('mongodb');
const url = 'mongodb://localhost:27017';
var _db;
module.exports = {
connectToServer: function(cb) {
mongoClient.connect(url, { useNewUrlParser: true }, function(err, client) {
_db = client.db('taskit');
return cb(err);
@binyamin
binyamin / readme.md
Last active June 8, 2020 22:11
AWS and Obsidian

AWS + Obsidian

Sync your obsidian vault with AWS cloud storage

  1. Create an aws account 🔗. There's a free tier.
  2. Create an IAM user
  3. Create an s3 bucket (navigate to s3 & click new button)
  4. Install AWS CLI 🔗
  5. Login to CLI with IAM keys
  6. Sync Notes!
    • aws s3 sync ~/path/to/notes s3://your-notes --delete --exclude ".obsidian/*"
@binyamin
binyamin / scripts.sh
Created September 3, 2020 17:57
Various useful shell scripts
# Kill a port running in the background
lsof -t -i:3000 | xargs kill
@binyamin
binyamin / index.js
Created October 8, 2020 21:08
Timing functions in node.js
const NS_PER_SEC = 1e9;
function test(func, ...args) {
let times = [];
for (let i = 0; i < 5; i++) {
const t = process.hrtime();
func(...args);
const diff = process.hrtime(t);
times.push((diff[0] * NS_PER_SEC) + diff[1]);
@binyamin
binyamin / bookmarks.json
Last active December 10, 2020 13:46
afinestart bookmarks
[
{
"groups": [
{
"name": "Design & Code",
"bookmarks": [
{
"name": "Figma",
"url": "https://www.figma.com/"
},

Keybase proof

I hereby claim:

  • I am binyamin on github.
  • I am binyamin (https://keybase.io/binyamin) on keybase.
  • I have a public key whose fingerprint is 64F0 693F 3022 0749 E571 1A5A C27D 091C 9A45 3A1E

To claim this, I am signing this object:

@binyamin
binyamin / eleventy-plugin-sass.js
Created January 2, 2022 19:08
Sass plugin for eleventy
const path = require("path");
const fs = require("fs");
const deepmerge = require("deepmerge");
const sass = require("sass");
const cleanCss = require("clean-css");
function minify(css) {
const cleaner = new cleanCss();
const minified = cleaner.minify(css);