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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* | |
* An (almost perfect) zoom function that zooms into the mouse cursor pointer. | |
* Assumes that the canvas is full screen - adjusting for this shouldn't be too | |
* tough. | |
* | |
* Attaches a zoom level update function to the mouse wheel event of | |
* the document. Calling this activates zooming via the mouse wheel. | |
* | |
* Assumes that it is part of a class of sorts. | |
* |
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
#include <string> | |
#include <iostream> | |
#include "ClassName.h" | |
using namespace std; | |
ClassName::ClassName() | |
{ | |
} |
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
.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 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 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 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 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 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 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} |