Skip to content

Instantly share code, notes, and snippets.

View drunkwcodes's full-sized avatar

drunkwcodes

  • Taipei
  • 03:49 (UTC +08:00)
View GitHub Profile
@adameubanks
adameubanks / PyDa.py
Created April 11, 2020 01:21
Code for the video where we build a Jarvis like virtual assistant in python 3
import wolframalpha
client = wolframalpha.Client("lilpumpsaysnopeeking")
import wikipedia
import PySimpleGUI as sg
sg.theme('DarkPurple')
layout =[[sg.Text('Enter a command'), sg.InputText()],[sg.Button('Ok'), sg.Button('Cancel')]]
window = sg.Window('PyDa', layout)
@PashCracken
PashCracken / WSL-with-zsh-and-powerlevel9k.png
Last active September 4, 2023 07:28
WSL, zsh and Powerlevel10k
WSL-with-zsh-and-powerlevel9k.png
@mattharrison
mattharrison / black_doctest.py
Last active June 22, 2020 20:48
This script runs black on a text file with doctest and blackens them....
import argparse
import sys
import black
from blib2to3.pgen2.tokenize import TokenError
TEST_DATA = """
Normal
$ cat t.py
from pprint import pprint
from pytheory import Tone, Fretboard, charts_for_fretboard


tones = (
    Tone.from_string("F2"),
    Tone.from_string("C3"),
    Tone.from_string("G3"),

Tone.from_string("D4"),

@namannik
namannik / HtmlEditor.py
Last active May 14, 2022 16:42
PyGTK HTML WYSIWYG Editor
import os
import gi
gi.require_version("Gtk", "3.0")
gi.require_version('WebKit2', '4.0')
from gi.repository import Gtk, Gdk, WebKit2
class HtmlEditor(Gtk.Window):
def __init__(self):
super().__init__()
@lattner
lattner / TaskConcurrencyManifesto.md
Last active March 7, 2026 21:39
Swift Concurrency Manifesto
@cclauss
cclauss / theBlues.py
Last active July 28, 2024 14:29
Play a blues melody on Pythonista on the iPad (iOS)
# Play a blues melody on Pythonista on the iPad (iOS)
import sound
import time
def playNotes(inNotes, inWithEmphisis=False):
for note in inNotes:
sound.play_effect('Piano_' + note)
if (inWithEmphisis):
time.sleep(0.25)
sound.play_effect('Piano_' + note)
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'