Skip to content

Instantly share code, notes, and snippets.

@kharysharpe
kharysharpe / print_with_win32print.py
Created September 16, 2019 03:10 — forked from buptxge/print_with_win32print.py
Print image using win32print and PIL
import win32print
import win32ui
from PIL import Image, ImageWin
PHYSICALWIDTH = 110
PHYSICALHEIGHT = 111
printer_name = win32print.GetDefaultPrinter ()
file_name = "new.jpg"
@kharysharpe
kharysharpe / gist:1f3a216d868cfe4c6aad1c04850df448
Created October 22, 2019 17:56 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@kharysharpe
kharysharpe / custom-queries.php
Created January 31, 2020 12:39 — forked from carlodaniele/custom-queries.php
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@kharysharpe
kharysharpe / DimDate.sql
Created May 3, 2020 01:38 — forked from sfrechette/DimDate.sql
Create and populate DimDate Table...
create table dbo.DimDate
(
DateKey int not null,
FullDate date not null,
DayNumberOfWeek tinyint not null,
DayNameOfWeek nvarchar(10) not null,
WeekDayType nvarchar(7) not null,
DayNumberOfMonth tinyint not null,
DayNumberOfYear smallint not null,
WeekNumberOfYear tinyint not null,
DROP TABLE if exists d_date;
CREATE TABLE d_date
(
date_dim_id INT NOT NULL,
date_actual DATE NOT NULL,
epoch BIGINT NOT NULL,
day_suffix VARCHAR(4) NOT NULL,
day_name VARCHAR(9) NOT NULL,
day_of_week INT NOT NULL,
DROP TABLE if exists d_date;
CREATE TABLE d_date
(
date_dim_id INT NOT NULL,
date_actual DATE NOT NULL,
epoch BIGINT NOT NULL,
day_suffix VARCHAR(4) NOT NULL,
day_name VARCHAR(9) NOT NULL,
day_of_week INT NOT NULL,
@kharysharpe
kharysharpe / README.md
Created October 4, 2020 02:01
Hourly and Daily MYSQL Backup / Dump with Retention Period

Steps

Create directories

mkdir -p /backup/mysql/hourly
mkdir -p /backup/mysql/daily

Set permissions on scripts:

@kharysharpe
kharysharpe / contemplative-llms.txt
Created January 6, 2025 22:57 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference