Skip to content

Instantly share code, notes, and snippets.

View demosdemon's full-sized avatar
🏠
Working from home

Joachim Brandon LeBlanc demosdemon

🏠
Working from home
View GitHub Profile
@oscarmorrison
oscarmorrison / IFTTTDate.md
Last active December 3, 2023 21:44
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

@pudquick
pudquick / lockscreen.py
Created December 23, 2015 19:12
Programmatically immediately lock the screen of a Mac running OS X, regardless of security settings, screensaver settings, or Fast User Switch settings
from ctypes import CDLL
loginPF = CDLL('/System/Library/PrivateFrameworks/login.framework/Versions/Current/login')
result = loginPF.SACLockScreenImmediate()
@ducas
ducas / Create-Administrator.ps1
Last active May 22, 2024 09:29
Create a local administrator account using PowerShell
$Username = "su"
$Password = "password"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
@sboisson
sboisson / ssdp.py
Last active March 21, 2016 18:50 — forked from dankrause/ssdp.py
#!/usr/bin/python
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@hubgit
hubgit / glyphicon-spacing.css
Last active January 10, 2019 11:18
Spacing for Bootstrap Glyphicons in buttons
.btn .glyphicon {
margin-right: 4px;
vertical-align: middle;
}
.btn.btn-icon .glyphicon {
margin-right: 0;
}
@dankrause
dankrause / _hover_example.py
Last active September 10, 2024 19:45
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@minimum2scp
minimum2scp / debtree-web.rb
Last active November 27, 2022 19:29
A web interface for debtree, apt-cache dotty using sinatra (ruby)
#! /usr/bin/env ruby
# -*- coding: utf-8; -*-
##
## debtree と apt-cache dotty の web インターフェース
## (コマンドラインオプション覚えてられない)
##
## apt-cache dotty については apt-cache(8) を参照
## debtree については以下のサイトを参照
## http://collab-maint.alioth.debian.org/debtree/index.html
@jammycakes
jammycakes / LazyDisposable.cs
Last active December 26, 2022 22:31
A subclass of System.Lazy<T> that implements IDisposable and forwards calls to the Dispose method on to the lazily created instance if it exists.
/// <summary>
/// A <see cref="Lazy"/> object that implements <see cref="IDisposable"/>.
/// </summary>
/// <typeparam name="T">
/// The object being lazily created.
/// </typeparam>
public class LazyDisposable<T> : Lazy<T>, IDisposable where T: IDisposable
{
/// <summary>
@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""