Skip to content

Instantly share code, notes, and snippets.

View Ultrabenosaurus's full-sized avatar

Ultrabenosaurus

  • UK
  • 08:24 (UTC)
View GitHub Profile
@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {
@chrisl8888
chrisl8888 / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
jTypes('struct Color', function(red, green, blue)
{
this.red = red;
this.green = green;
this.blue = blue;
},
{
'public int red': 0,
'public int green': 0,
'public int blue': 0
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
# yolo
<input type="text" autofocus>
</body>
@shamil
shamil / mount_qcow2.md
Last active November 5, 2025 00:00
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@dan-bennett
dan-bennett / aliases.sh
Last active August 29, 2015 14:05
my shell aliases
#!/bin/bash
# backup "<path>"
# create a new folder in the backups directory and dump the current directory's contents into it
backup(){
mkdir "/path/to/backups/$1";
cp -r . "/path/to/backups/$1";
}
# bs

ajax.x - The XMLHttpRequest object (or MS equivalent) used for communication

ajax.serialize(f) f = the form element you wish to be serialized This function serializes all the fields in a form so that they can be passed as a query string in the form 'arg1=val1&arg2=val2'.

ajax.get(url, func) url = the url to query (can contain arguments after a '?') func = the function to call once the response is returned This function uses a GET request to query the specified url and return a response to the specified function.

@walkerstone
walkerstone / index.html
Created October 28, 2014 15:39
Single page template
<html>
<head>
<style>
html { height: 101%; }
body { margin: 0; padding: 0; font-family: sans-serif;}
h1, h2, h3 { margin: 0; }
a { font-weight: ; text-decoration: none; color: #586FB2;}
.active { background: #586FB2; color: white;}
@0xDE57
0xDE57 / config.md
Last active October 24, 2025 12:09
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@TimBlock
TimBlock / 4.5
Created January 15, 2016 12:00
// Your code here.
function every(array,predicate){
for(var i = 0; i<array.length; i++){
if (!predicate(array[i]))
return false;
}
return true;
}
function some(array,predicate){