This file contains hidden or 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 renderCross(context, pos, size) | |
{ | |
var radius = size / 2; | |
context.beginPath(); | |
context.moveTo(pos.x - radius, pos.y - radius); | |
context.lineTo(pos.x + radius, pos.y + radius); | |
context.moveTo(pos.x + radius, pos.y - radius); | |
context.lineTo(pos.x - radius, pos.y + radius); | |
context.lineWidth = 3; |
This file contains hidden or 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
#!/usr/bin/env bash | |
width=$(identify -ping -format "%w" "$1") | |
height=$(identify -ping -format "%h" "$1") | |
raw_options=$(yad --center --title "Resize image" --form --float-precision 0 --field "Filename":RO --field "Width":NUM --field "Height":NUM --field "Preserve aspect ratio":CHK "$1" "$width" "$height" true) | |
# 0: Filename | |
# 1: Width | |
# 2: Height |
This file contains hidden or 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
<?php | |
/******************************************************************************* | |
******************************* resizeImage.php ******************************* | |
******************************************************************************* | |
* Resizes a GD image to fit inside a square of the given size. | |
******************************************************************************/ | |
function resize_image($image, $size) | |
{ | |
$cur_width = imagesx($image); | |
$cur_height = imagesy($image); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>SSL Certificate Status Panel</title> | |
</head> | |
<body> | |
<h1>SSL Certificate Status Panel</h1> | |
<?php |
This file contains hidden or 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
namespace System | |
{ | |
public static class StringExtensions | |
{ | |
/// <summary> | |
/// Pads the string on both sides. | |
/// </summary> | |
/// <param name="length">The length to pad the string to.</param> | |
public static string PadBoth(this string str, int length) | |
{ |
This file contains hidden or 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
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
This file contains hidden or 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
/** | |
* Gets the first containing parent element of a given type for a given child element. | |
* @param {HTMLElement} element The child element to find the parent of. | |
* @param {string} type The name of the element containing parent to search for. | |
*/ | |
function GetContainingElement(element, type) | |
{ | |
while(element !== null && element.tagName.toLowerCase() !== type.toLowerCase()) { | |
element = element.parentNode; | |
} |
This file contains hidden or 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
.badge-text:after | |
{ | |
content: attr(data-badge-content); | |
z-index: 10000; | |
position: absolute; | |
top: 60%; left: 50%; | |
width: 1em; height: 1em; | |
background: white; |
This file contains hidden or 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
"use strict"; | |
/** | |
* Constants for the different readyStates that a WebSocket can be in. | |
* @type {Object} | |
*/ | |
const WebSocketStates = { | |
/** | |
* Indicates that the WebSocket is connecting to the remote server. | |
* @type {Number} |
This file contains hidden or 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
<?php | |
namespace SBRL\Utilities; | |
use \stdClass; | |
/** | |
* Handles the loading and saving of settings from a file. | |
* Supports loading default settings from a separate file. | |
* @author Starbeamrainbowlabs |