Skip to content

Instantly share code, notes, and snippets.

View klokie's full-sized avatar

Daniel Grossfeld klokie

View GitHub Profile
import Anthropic from '@anthropic-ai/sdk';
import { Glob } from 'bun';
export const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_KEY
});
const glob = new Glob("./txt/*.txt");
type Page = {
@error9900
error9900 / get_completed_items.py
Created November 10, 2023 06:42
Get completed items from Todoist
"""
Put your token in data/token.txt.
Completed items are written to `output/completed_items.py` as a Python dictionary.
Reference: https://developer.todoist.com/sync/v9/#get-all-completed-items
"""
import requests
@carlssonk
carlssonk / deploy_node_do.md
Last active February 18, 2024 16:38
Deploy node.js app to DigitalOcean

Deploy Node.js Application to DigitalOcean

This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.

Prerequisites

Create Droplet & Generate SSH Key

@enihsyou
enihsyou / split_tunneling.sh
Created December 20, 2019 08:04
Network tweaking script to make Internet access available while connection to Danone Pulse Secure VPN (Split tunneling).
#! /usr/bin/env bash
# Author: Ryoka Kujo s1131234@gmail.com
# Descripthon: Network tweaking script to make Internet access available
# while connection to Pulse Secure VPN.
# network interface list can be retrieved by `networksetup -listallhardwareports`
# specify your network interface for internet access.
PUBLIC_INTERFACE=en7
# specify your network interface for VPN tunnel access.
TUNNEL_INTERFACE=utun2
@Mau5Machine
Mau5Machine / docker-compose.yml
Last active July 4, 2024 16:57
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@davidfcarr
davidfcarr / gutenbeg-notification.js
Created March 17, 2019 13:30
Custom notification in WordPress Gutenberg
// context check: if this is an rsvpmaker template, this will have be available as localized data from PHP
if((typeof rsvpmaker_json !== 'undefined' ) && rsvpmaker_json.projected_url) {
let wasSavingPost = wp.data.select( 'core/editor' ).isSavingPost();
let wasAutosavingPost = wp.data.select( 'core/editor' ).isAutosavingPost();
let wasPreviewingPost = wp.data.select( 'core/editor' ).isPreviewingPost();
// determine whether to show notice
subscribe( () => {
const isSavingPost = wp.data.select( 'core/editor' ).isSavingPost();
const isAutosavingPost = wp.data.select( 'core/editor' ).isAutosavingPost();
@klokie
klokie / Clone Wars Chronological Episode Order.md
Last active July 28, 2018 21:24
Star Wars - The Clone Wars Chronological Episode Order
@pixeline
pixeline / php_upgrade_to_71.sh
Last active March 16, 2023 16:49
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@hexsprite
hexsprite / gist:fcffe47f814f41402a41273d2e79029f
Created October 15, 2016 05:06
Profiling Meteor with v8-profiler from meteor shell
profiler = require('v8-profiler')
profiler.startProfiler()
profile = profiler.stopProfiler()
profile.export().pipe(fs.createWriteStream('profile.json')).on('finish', function() { profile.delete(); });
@Marqin
Marqin / ExportChromePasswords.js
Last active February 26, 2018 17:52 — forked from beaverb1ll/ExportChromePasswords.js
ExportChromePasswords.js
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"';
for(i=0; i<model.length; i++){