Skip to content

Instantly share code, notes, and snippets.

@MartinThoma
MartinThoma / .vimrc
Created April 9, 2013 14:25
My current .vimrc file.
syntax on " enable syntax highlighting
filetype on " enable file type detection
" Set some nice character listings, then activate list
set list listchars=tab:⟶\ ,trail:·,extends:>,precedes:<,nbsp:%
set list
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
// tries to execute the uri:scheme
function uriSchemeWithHyperlinkFallback(uri, href) {
if(!window.open(uri)){
window.location = href;
}
}
@ajaegers
ajaegers / js-regex-replace-links-to-markdown
Created June 17, 2014 11:10
Regex Html link to Markdown syntax
@ttscoff
ttscoff / appinfo.md
Last active June 11, 2024 18:07
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

@PhilMurwin
PhilMurwin / RasPiNamecheapDNS.md
Last active June 29, 2024 17:44
How to setup DDclient on Raspberry Pi for use with Namecheap DynDNS

How to use Namecheap DynDNS service with ddclient on the Raspberry Pi

Log into your Raspberry Pi (by ssh for example) or open a terminal window if you are working directly on Pi. In the first step we have to install ddclient, a DynDNS software, on the Pi. For this purpose, the following two commands are necessary.

sudo apt-get update
sudo apt-get install ddclient

Note: During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.

@nbonfire
nbonfire / mysubaru.py
Created May 20, 2019 15:49
MySubaru python samples
import requests, json
from subarucreds import username,password,pin # just a "subarucreds.py" that has some variables i didn't want to share
import datetime
#login
s=requests.Session()
loginr=s.post('https://www.mysubaru.com/login', data = {'username':username,'password':password})
#should return a response 200
#Where's my subaru?
@andreasRedeker
andreasRedeker / webcam-widget.js
Created November 12, 2020 20:03
An iPhone widget, that shows you a live webcam image from foto-webcam.eu on your homescreen
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: camera-retro;
// Script by Andreas Redeker <hello@andreasredeker.de>
let param = args.widgetParameter
let url
if (param != null && param.length > 0) {
url = param
@jglev
jglev / Example Output.md
Last active August 30, 2023 20:42
Use Obsidian Notes' Templater Plugin (https://github.com/SilentVoid13/Templater) to add links to GitHub Issues from specific public or private repositories using a searchable prompt

Screenshot of suggester prompt

Resulting output:

[`octocat/Hello-World #1053`](https://github.com/octocat/Hello-World/issues/1053)
@todbot
todbot / mqtt_demo_code.py
Created October 10, 2021 18:47
CircuitPython MQTT demo using public.cloud.shiftr.io
# mqtt_demo_code.py -- MQTT demo using public.cloud.shiftr.io
# 9 Oct 2021 - @todbot
#
# Uses LEDs on Adafruit Funhouse but adaptable to any CircuitPython WiFi board.
#
# To see what's going on, download MQTT-Explorer from http://mqtt-explorer.com/
# Launch it and connect to the MQTT host/port/username/password as in secrets below.
#
# From MQTT-Explorer, you should see messages to "todbot/feeds/hello" every 3 seconds
# And then you can go to the right of MQTT-Explorer to Publish, fill in "todbot/feeds/light",
import socket
import threading
from queue import Queue
target = "URL/IP"
queue = Queue()
ope_port = []
def scanner(port):
try: