Skip to content

Instantly share code, notes, and snippets.

@elifiner
elifiner / gist:fd6267f2695c2d10fd0602def1dee7cd
Created February 20, 2025 05:07
Karabiner map Terminal.app Cmd+Left to Home and Cmd+Right to End
{
"description": "Terminal",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$"
],
"type": "frontmost_application_if"
import os
import time
from dotenv import load_dotenv
from mem0 import MemoryClient
MEMORY_CONTENT = """The second thing I want to capture is Learning - looks like going top to bottom is useful here.
I'm trying to build a curriculum to fill in my gaps in general knowledge. I want to become an educated person with enough grasp of the fundamentals of many (all?) subjects to have an intelligent discussion on any topic. The word "erudite" comes to mind. Maybe something like Elon Musk when he's not talking about things he has specific skill in (engineering and rocket science). Possibly similar to the classical education ideas we're exploring for homeschooling with The Core by Leigh Bortins. It's a bit overwhelming to consider, but here's an initial list of topics: history, literature, philosophy, geography, politics (theory and practice), math (esp. linear algebra, calculus and statistics), economy, biology, chemistry, physics ability to read scientific papers, a few additional languages - likely German, Arabic, F
@elifiner
elifiner / chat.py
Last active April 27, 2023 03:23
Simple command line chat with Open AI ChatGPT
import os
import openai
import readline
from datetime import date
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv('OPENAI_API_KEY')
assistant_name = "Assistant"
@elifiner
elifiner / momentjs-timezones.js
Created July 20, 2021 18:31
Parse timezones with momentjs
const moment = require('moment-timezone');
// parse time with timezone, convert to UTC, resulting object is in UTC
console.log(moment.utc('23:05+02:00', ['hh:mm a ZZ', 'HH:mmZZ'], true).format());
// parse time with timezone, resulting object is in timezone specified in the time string
console.log(moment.parseZone('23:05+02:00', ['hh:mm a ZZ', 'HH:mmZZ'], true).format());
// parse time with timezone, resulting object is converted to timezone specified in the timezone parameter
console.log(moment.tz('23:05+02:00', ['hh:mm a ZZ', 'HH:mmZZ'], 'America/Vancouver').format());
Hey there. My name is Eli Finer.
Welcome to Wuju.
These are difficult times in India. There is fear, uncertainty and doubt everywhere. Hospitals are running out of critical supplies. Many people are sick and some are dying. And yet there is light as well. The Indian people are coming together, helping each other harnessing resources and working to resolve the situation with fierce determination.
Any difficulty we face can be made worse or better, depending on the quality of our thoughts. Negative, self-defeating thoughts make every challenge seem impossible. They drain our energy and limit our options. Positive or clear thinking can help us see new ways to improve our situation. It can help us find compassion for ourselves and for others and even improve the way our bodies deal with disease.
We can't change how we feel and what we think directly. Trying to do this through sheer force of will usually results in self judgment, shame and guilt. And that only adds to the already full arsenal of negative think
var Quotes = [
{
"text":"You don't fail until you stop trying.",
"from":"Albert Einstein"
},
{
"text":"I failed my way to success.",
"from":"Thomas Edison"
},
{
<?php
$options = [
'a' => [1,2],
'b' => [1,2,3],
];
function cartesian($array)
{
if ($array)
@elifiner
elifiner / openssl_self_signed.md
Created November 26, 2019 22:41 — forked from gmassawe/openssl_self_signed.md
Creating Self Signed Certificate

Create self-signed certificates with OpenSSL

Root CA

Create Root CA key (enable password with '-des3' option)

$ openssl genrsa -des3 -out root.key 4096

Create Root CA

@elifiner
elifiner / wp-login-stubs.php
Last active November 9, 2019 01:11
Wordpress 2.0 wp-login.php for refactoring
<?php
// RG: Stubs to make wp-login.php run independently of Wordpress codebase on modern PHP.
error_reporting(0);
$_REQUEST['action'] = $_REQUEST['action'] ?? '';
class wpdb {
public $users;
(cat .env.default .env | sed 's/^/export /'; echo env) | env -i bash - | grep -v SHLVL | grep -v ^_ | grep -v PWD | sort