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
// converter rgba(r, g, b, a) color to #HEX string without alpha channel, | |
// with optional applying afterwards opacity ($opacity) | |
// by default alpha channel for rgba-color is applying against white background, | |
// but you can change it by setting third argumnet ($background) | |
@function rgba-to-rgb($rgba, $opacity: 0, $background: #fff) { | |
@if $opacity > 0 { | |
@if $opacity < 1 { | |
$opacity: $opacity * 100 | |
} | |
@return mix(mix(rgb(red($rgba), green($rgba), blue($rgba)), $background, alpha($rgba) * 100%), rgb(255,255,255), $opacity) |
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 _sqljs_download(name) { | |
function downloadBytes(body, filename, extension = 'db') { | |
const blob = new Blob([body]); | |
const fileName = `${filename}.${extension}`; | |
const link = document.createElement('a'); | |
if (link.download !== undefined) { | |
const url = URL.createObjectURL(blob); |
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(DBName) { | |
var raw_DB = localStorage.getItem(DBName); | |
if (raw_DB) { | |
window._db = (function(raw) { | |
let db = new SQL.Database(JSON.parse(raw)); | |
return { | |
run: function(sql) { | |
let data = db.exec(sql); |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: btsync daemon | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: BTSync server daemon | |
# Description: Daemon script to run a BTSync permanent peer | |
# Placed in /etc/init.d. |
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
@FOR /F "tokens=*" %%G IN ('VBoxManage list runningvms') DO @CALL :suspend %%G | |
:suspend | |
@SETLOCAL | |
@SET _name=%1 | |
@SET _uuid=%2 | |
@IF [%1]==[] GOTO:eof | |
@echo Suspend: %_name% | |
VBoxManage controlvm %_uuid% savestate | |
@ENDLOCAL |