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
docker system prune -a --volumes | |
net stop com.docker.service | |
taskkill /IM "docker.exe" /F | |
taskkill /IM "Docker Desktop.exe" /F | |
wsl --shutdown | |
((@" | |
select vdisk file="%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk |
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
step_brightness_up: | |
alias: Up brightness ceiling lamp | |
sequence: | |
- service: light.turn_on | |
target: | |
entity_id: light.livingroom_ceiling | |
data_template: | |
brightness: > | |
{% set step_size = 25 %} | |
{% set current_brightness = (state_attr('light.livingroom_ceiling', 'brightness') | int) %} |
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
const max = 1e9; | |
console.time(); | |
for (let i = 0; i < max; i++) {} | |
console.timeEnd(); | |
console.time(); | |
let j; | |
for (j = 0; j < max; j++) {} | |
console.timeEnd(); |
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
let canvas = document.getElementById('canvas'); | |
let ctx = canvas.getContext('2d'); | |
let slopeResolution = 20; | |
let slopeWidth = 100; | |
let slopes = 20; | |
let slopeHeight = 50; | |
let progress = 0; | |
let lastFrame = new Date().getTime(); |
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
var con=indexedDB.open('localforage',2) | |
con.onsuccess = (e) =>{ | |
let db = e.target.result | |
let t = db.transaction(['keyvaluepairs'],'readwrite') | |
let o = t.objectStore('keyvaluepairs') | |
let r=o.put(value,'KEY') | |
r=o.delete("KEY") | |
} |
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
print("\e[0;32;50m"); | |
print("Hi"); | |
print("\e[0m"); |
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
function rgb2hex(rgb){ | |
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i); | |
return (rgb && rgb.length === 4) ? "#" + | |
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[3],10).toString(16)).slice(-2) : ''; | |
} | |
var els = document.body.getElementsByTagName("*"); | |
var res={}; |
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
/** | |
* In the name of brevity, I present this little snippet of code that I made when I needed to make sure we weren't using some weird font | |
* on a company website. Just pasting this into a browser console will output a lit of all the font-family used on a specific page. | |
* This same snippet can be easily adjusted to retrieve an other css property, for example colors of a page | |
**/ | |
// Get a all the elements of a page | |
var elements = document.body.getElementsByTagName("*"); | |
// final output in the form of a dictionary where the key is the value of the style and the value is an array of elements that have that property |
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
require 'base64' | |
require 'digest/md5' | |
def crypt(pas,salt) | |
if salt.length == 0 | |
salt = makeSalt() | |
end | |
md = Digest::MD5.new() |