Skip to content

Instantly share code, notes, and snippets.

@rougier
rougier / clean.el
Created May 10, 2020 02:43
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
@widdowquinn
widdowquinn / emacs_python_ide.md
Last active April 27, 2023 17:36
Turning Emacs into a Python IDE

Turning emacs into a Python IDE

## Create a new config/initialisation file

Create a user-level initialisation file init.el:

touch .emacs.d/init.el
@Morreski
Morreski / timed_cache.py
Last active December 21, 2023 18:17
Python lru_cache with timeout
from datetime import datetime, timedelta
import functools
def timed_cache(**timedelta_kwargs):
def _wrapper(f):
update_delta = timedelta(**timedelta_kwargs)
next_update = datetime.utcnow() + update_delta
# Apply @lru_cache to f with no cache size limit
@fhatz
fhatz / MultiRoom.sh
Last active March 29, 2022 12:56
Samsung Multiroom - Console client
#! /bin/bash
# Author: F. Hatz
# based on 'https://github.com/bacl/WAM_API_DOC'
# start with MultiRoom.sh search (search for speakers)
# or with MultiRoom.sh Speaker-IP UUID OBJECTID [OBJECTID OBJECTID ...] volume
# or with MultiRoom.sh Speaker-IP fav1/fav2/fav3/radio1/radio2/radio3 volume
# or with MultiRoom.sh Speaker-IP play/pause/stop (song: play/pause radio: stop)
# or with MultiRoom.sh Speaker-IP next/previous
# or with MultiRoom.sh Speaker-IP mute on/off
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@samrocketman
samrocketman / libimobiledevice_ifuse_Ubuntu.md
Last active January 11, 2024 22:47
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

Audience

Who is this guide intended for?

@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active May 16, 2024 01:17
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@queckezz
queckezz / 00_overview.md
Last active September 15, 2022 11:22
An extensive excel vba documentation for creating large-scale apps without a total mess

Excel VBA

Many times you want to fiddle around with amazing tech like React or RustLang that are pushing the boundaries of what is possible. Back to the real world, there are still cases where an Excel sheet is more appropiate. Especially when companies previously built around it and have existing legacy code. Maybe the end user simply wants just one file to send per mail or move around. For this, Excel is still a viable option.

So for those people that are struggling with the limited vba language, this documentation aims to improve just a little bit of the developer experience while creating excel applications.

This may also partially apply to other office suite applications.

Feel free to send pull request with your Excel code that you found helpful or documentation additions.

@anthonyeden
anthonyeden / Python WExpect
Created January 18, 2014 10:40
Python's PExpect for Microsoft Windows: WExpect
"""Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be used for automated software testing. Pexpect is in the spirit of Don
Libes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python
require TCL and Expect or require C extensions to be compiled. Pexpect does not
use C, Expect, or TCL extensions. It should work on any platform that supports
the standard Python pty module. The Pexpect interface focuses on ease of use so
that simple tasks are easy.
@willurd
willurd / web-servers.md
Last active May 17, 2024 16:24
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000