Skip to content

Instantly share code, notes, and snippets.

"ChatGPT, please act as a supportive listener and provide empathetic responses while we discuss my thoughts and feelings."
"Assume the role of a virtual counselor, offering me guidance and encouragement as we talk about my personal challenges."
"Please take on the persona of a life coach, helping me explore my thoughts and emotions, and providing gentle guidance in our conversation."
"Adopt the role of a friendly advisor, offering compassionate and non-judgmental responses as we discuss various aspects of my life."
"ChatGPT, become a therapeutic conversation partner, providing a safe space for me to express my thoughts, feelings, and concerns, while offering supportive feedback."
@tdpetrou
tdpetrou / basictransformer.py
Last active September 7, 2023 13:44
A custom scikit-learn transformer for one-hot encoding categorical values, and standardizing numeric columns
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator
class BasicTransformer(BaseEstimator):
def __init__(self, cat_threshold=None, num_strategy='median', return_df=False):
# store parameters as public attributes
self.cat_threshold = cat_threshold
@Yatoom
Yatoom / setup.md
Last active April 19, 2024 06:41
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
@muktupavels
muktupavels / toggle-decorations.c
Last active January 28, 2024 12:59
Simple app to toggle window decorations.
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@mosquito
mosquito / README.md
Last active May 10, 2024 20:44
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@zilexa
zilexa / scantokodi.sh
Created July 15, 2016 19:27
Let Transmission notify Kodi of a finished download so that it will scan that particular file to the library (it will not do a full library update)
/usr/bin/wget --header='Content-Type:application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "osmc", "params": {"directory":"'"$TR_TORRENT_DIR"'/"}}' "http://localhost:8080/jsonrpc"
"""
Programming task
================
The following is an implementation of a simple Named Entity Recognition (NER).
NER is concerned with identifying place names, people names or other special
identifiers in text.
Here we make a very simple definition of a named entity: A sequence of
at least two consecutive capitalized words. E.g. "Los Angeles" is a named
#lang scheme
(require rackunit)
(require rackunit/text-ui)
(define minimal-maze
'(
(w w w)
(w 0 w)
(w w w)
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8