Skip to content

Instantly share code, notes, and snippets.

View dterracino's full-sized avatar
🐢
I may be slow to respond…

David Terracino dterracino

🐢
I may be slow to respond…
View GitHub Profile
@dterracino
dterracino / solarized-dark.conf
Created December 10, 2020 05:50 — forked from onli/solarized-dark.conf
Solarized Dark for Geany with highlighted comments and stronger bracket highlight
#
# Copyright 2011 Ethan Schoonover <es(at)ethanschoonover(dot)com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
@dterracino
dterracino / izulu
Created December 10, 2020 05:50 — forked from onli/izulu
izulu 1.1
#!/bin/bash
# izulu - Change the wallpaper according to the weather
#
# Copyright (C) 2009 Malte Paskuda
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
class ElectedOrderedListItem
# subitem: the item itself, the payload
# lowerItems: A list of items that were seen before this item
# seen: How often it was seen before
# rating: rating to store if there is no other way
attr_accessor :payload, :rating, :seen, :lowerItems
def initialize(payload, rating)
# mol: A maybe ordered list, by preserving some order on merge
#
# Concept:
# We have an ordered list with values. If another list shall be merged in,
# merge each new item below an item known in both lists that has a higher
# value (=big brother), or above one that has a smaller value. If there
# exists no such item, use the item value to find a higher item, and
# insert below. When adding an item that exists already, average its value
# and reposition as if it were a new item.
#
@dterracino
dterracino / explode-path.sh
Created November 23, 2020 16:22 — forked from lavoiesl/explode-path.sh
Split paths into each components
#!/bin/bash
# Example:
# $ explode-path ~
# /
# /Users
# /Users/seb
# Great for recursively checking permissions
@dterracino
dterracino / extract-func-comment-string.js
Created November 23, 2020 16:20 — forked from lavoiesl/extract-func-comment-string.js
Extract a function's comment, useful to have multiline string
/*!
* Extract a function's comment, useful to have multiline string
* @link https://gist.github.com/lavoiesl/5880516
*
* Don't forget to use /*! to avoid the comment being removed in minification
*/
// Example:
// var myString = extractFuncCommentString(function(){/*!
// <p>
// foo bar
<#
.SYNOPSIS
Listens to and read data from a serial port (e.g. COM port)
.DESCRIPTION
The purpose of this script is to keep listening and read data from a serial port.
All the data captured will be displayed and log into a file.
.EXAMPLE
./SerialPortReader.ps1
.EXAMPLE
./SerialPortReader.ps1 -PortName COM3 -BaudRate 9600
@dterracino
dterracino / code.md
Created October 8, 2020 10:02 — forked from erfansahaf/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI

@dterracino
dterracino / Reset-BashPassword.ps1
Created October 4, 2020 14:43 — forked from richardszalay/Reset-BashPassword.ps1
Reset-BashPassword.ps1
# Resets the password for the default LXSS / WSL bash user, based on https://askubuntu.com/a/808425/697555
$lxssUsername = (Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss).DefaultUsername
lxrun /setdefaultuser root
bash -c "passwd $lxssUsername"
lxrun /setdefaultuser $lxssUsername
@dterracino
dterracino / lol.js
Created October 1, 2020 05:29 — forked from wesbos/lol.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};