This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import Cocoa #from PyObjC, https://pyobjc.readthedocs.io/ | |
import argparse | |
import sys, re | |
#taken from https://stackoverflow.com/questions/29643352/converting-hex-to-rgb-value-in-python | |
def hex_to_rgb(hx, hsl=False): | |
"""Converts a HEX code into RGB or HSL. | |
Args: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import Quartz | |
from Quartz.CoreGraphics import * | |
import Cocoa | |
# element : [ element width, name width word 1, name width word 2 (or 0.0), name ] | |
labels = { | |
"Cp" : [0.0, 0.0, 0.0, "Chili Powder"], | |
"Bs" : [0.0, 0.0, 0.0, "Black Sesame"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
print (datetime.datetime.now().strftime("%d %b %Y %-H:%M %p")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bookmaklet to fill in current puzzle with all pencil marks | |
// I don't know the source of this | |
javascript:javascript:var%20kMax=1;for(i=1;i<10;i++){var%20lMax=1;if(i==kMax)kMax+=3;for(j=1;j<10;j++){if(j==lMax)lMax+=3;if(grid[i][j].value==''){ClearTinySquares(i,j);for(k=1;k<10;k++)grid[i][j]['mini'][k]=1;for(k=1;k<10;k++){var%20tmp=grid[i][k].value;if(tmp!='')grid[i][j]['mini'][tmp]=0;tmp=grid[k][j].value;if(tmp!='')grid[i][j]['mini'][tmp]=0}for(k=kMax-3;k<kMax;k++){for(l=lMax-3;l<lMax;l++){var%20tmp=grid[k][l].value;if(tmp!='')grid[i][j]['mini'][tmp]=0}}}}}PopulatePuzzle(grid); | |
//bookmarklet to show alert with puzzle in good sudoku format | |
javascript:(function()%7Bms%20%3D%20master_string%20%2B%20'%2C'%3Bga%20%3D%20ms.split('%2C')%3Bgg%20%3D%20%22%22%3Bfor%20(j%3D0%3B%20j%3C41%3B%20j%2B%2B)%20%7Bi%20%3D%20j*2%3Bif%20(ga%5Bi%5D%20!%3D%20%22%22)%20%7Bs%20%3D%20parseInt(ga%5Bi%5D)%3B%7Delse%20%7Bs%20%3D%200%3B%7Dif%20(ga%5Bi%2B1%5D%20!%3D%20%22%22)%20%7Bt%20%3D%20parseInt(ga%5Bi%2B1%5D)%7Delse%20%7Bt%20%3D%200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ga=master_string.split(','); | |
gg=""; | |
for (j=0;j<81;j++){ | |
if (ga[j]=="")gg=gg+"."; | |
else gg=gg+ga[j]; | |
if (j==0) continue; | |
else if (j==80) break; | |
else if (j%27==26) gg=gg+"\n---+---+---\n"; | |
else if (j%9==8) gg=gg+"\n"; | |
else if (j%3==2) gg=gg + "|"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import base64 | |
#Good Sudoku's share puzzle clipboard format | |
#given the starting puzzle: | |
#7.. 64. 2.. | |
#.6. 7.. 4.. | |
#..8 ..5 .9. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// Sodoku | |
// | |
// Created by Kent Miller on 4/7/20. | |
// Copyright © 2020 Kent Miller. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in keybindings.json | |
[ | |
{ "key": "shift+ctrl+down", "command": "cursorColumnSelectDown", | |
"when": "editorTextFocus" }, | |
{ "key": "shift+ctrl+up", "command": "cursorColumnSelectUp", | |
"when": "editorTextFocus" }, | |
{ "key": "PageUp", "command": "scrollPageUp", | |
"when": "editorTextFocus" }, | |
{ "key": "PageDown", "command": "scrollPageDown", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import colorsys | |
def PrintHex(v): | |
vv0 = v[0] * 255.0 | |
vv1 = v[1] * 255.0 | |
vv2 = v[2] * 255.0 | |
print ( "#%02X%02X%02X" % (vv0, vv1, vv2)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#tested on 10.12 and 10.13 | |
import Quartz | |
from Quartz.CoreGraphics import * | |
import Cocoa | |
import random | |
random.seed() |
NewerOlder