(Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in the Wiki article )
Discover gists
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 os | |
import gridfs | |
from django.http import HttpResponse | |
from pymongo.connection import Connection | |
from django.shortcuts import get_object_or_404, render_to_response | |
from django.http import HttpResponseRedirect, HttpResponse | |
from django.template import Context, RequestContext,loader | |
from bson.object import ObjectId | |
#uploading form including image/file |
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
//This quick guide will show you how add an optional web-app (iOS) view to your Twine game! | |
//First you'll need to open up your Twine (.tws) file. | |
1. Add a new passage to your story and name it "script" | |
2. Enter the tags section and add the word "script" | |
3. Now, in the main body, add the code: | |
document.addEventListener('touchmove', function(e) { | |
e.preventDefault(); | |
}, false); |
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
type GrabConstructorParameters<T> = { | |
[K in keyof T]: T[K] extends new (...args: infer P) => any ? P : never; | |
} | |
// https://stackoverflow.com/a/50375286 | |
type UnionToIntersection<U> = | |
(U extends any ? (x: U)=>void : never) extends ((x: infer I)=>void) ? I : never | |
type JoinConstructors<T extends (new (...args:any[]) => any)[]> = | |
new (...args: GrabConstructorParameters<T>) => UnionToIntersection<InstanceType<T[number]>> |
Quick install guide for Arch -- if you're looking for an automated installer, consider Arch Anywhere.
Download the latest version from: https://www.archlinux.org/download/
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
bind-key -n 'C-\' run-shell -b ${HOME}/.local/bin/tmux-toggle-term |
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
# Thanks to commenters for providing the base of this much nicer implementation! | |
# Save and run with $ python 0dedict.py | |
# You may need to hunt down the dictionary files yourself and change the awful path string below. | |
# This works for me on MacOS 10.14 Mohave | |
from struct import unpack | |
from zlib import decompress | |
import re | |
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data' | |
f = open(filename, 'rb') |
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 UIKit | |
final class TransitionDelegate: NSObject, | |
UIViewControllerTransitioningDelegate { | |
private let interactiveController = UIPercentDrivenInteractiveTransition() | |
private let duration = CATransaction.animationDuration() | |
func presentationController(forPresented presented: UIViewController, |
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
# This script will manually rip out all VMware Tools registry entries and files for Windows 2008-2019 | |
# Tested for 2019, 2016, and probably works on 2012 R2 after the 2016 fixes. | |
# This function pulls out the common ID used for most of the VMware registry entries along with the ID | |
# associated with the MSI for VMware Tools. | |
function Get-VMwareToolsInstallerID { | |
foreach ($item in $(Get-ChildItem Registry::HKEY_CLASSES_ROOT\Installer\Products)) { | |
If ($item.GetValue('ProductName') -eq 'VMware Tools') { | |
return @{ | |
reg_id = $item.PSChildName; |
NewerOlder