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
.ui-btn, | |
.ui-btn h4, | |
html body .ui-group-theme-a .ui-bar-inherit, | |
html body .ui-group-theme-a a, | |
html body .ui-group-theme-b .ui-bar-inherit, | |
html body .ui-group-theme-b a, | |
label.ui-btn { | |
font-weight: normal !important; | |
} |
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
fs.exists(file, function (exists) | |
{ | |
if (exists) | |
{ | |
fs.stat(file, function (error, stats) | |
{ | |
fs.open(file, "r", function (error, fd) | |
{ | |
var buffer = new Buffer(stats.size); | |
fs.read(fd, buffer, 0, buffer.length, null, function (error, bytesRead, buffer) |
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
// usage: | |
// EventEmitter.mixin(myObject) | |
// myObject.emit('eventname', param1, param2, etc) | |
// myObject.on('eventname', function(param1, param2, etc) {}) | |
var EventEmitter = function () {}; | |
EventEmitter.prototype = { | |
// add event handler | |
on: function (event, fn) |
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 the browser's built-in functionality to quickly and safely escape the string | |
function escapeHtml(str) | |
{ | |
var div = document.createElement('div') | |
div.appendChild(document.createTextNode(str)) | |
return div.innerHTML | |
} | |
// UNSAFE with unsafe strings; only use on previously-escaped ones! | |
function unescapeHtml(escapedStr) |
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
// Full version of `log` that: | |
// * Prevents errors on console methods when no console present. | |
// * Exposes a global 'log' function that preserves line numbering and formatting. | |
(function () { | |
var method; | |
var noop = function () { }; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', | |
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', | |
'markTimeline', 'profile', 'profileEnd', 'table', 'time', '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
@echo off | |
REM Administrative check from here: https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights | |
REM Vaccination discovered by twitter.com/0xAmit | |
REM Batch file created by Lawrence Abrams of BleepingComputer.com. @bleepincomputer @lawrenceabrams | |
echo Administrative permissions required. Detecting permissions... | |
echo. | |
net session >nul 2>&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
// usage | |
// const obj = /* ... */; | |
// const sc = await jsclone.structuralClone(obj); | |
// const c = jsclone.clone(obj); | |
moudule.exports = { | |
structuralClone(obj) => { | |
return new Promise(resolve => { | |
const {port1, port2} = new MessageChannel(); |
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
1) Reference | |
Many will know this already, but I need to make sure you know it because it’s so fundamental. | |
A ‘reference’ is a string that points to a commit. | |
There are four main types of reference: HEAD, Tag, Branch, and Remote Reference. | |
HEAD | |
HEAD is a special reference that always points to where the git repository is. | |
If you checked out a branch, it’s pointed to the last commit in that branch. |
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
### Keybase proof | |
I hereby claim: | |
* I am receptor on github. | |
* I am sebp (https://keybase.io/sebp) on keybase. | |
* I have a public key ASBlTt0ie4yELLDigD6AcIH-B-AqIIlEONlZEZ2MnwRp4Qo | |
To claim this, I am signing this object: |
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
ENCRYPT | |
$ echo "my secret message" | openssl aes-256-cbc -a -salt | |
enter aes-256-cbc encryption password: | |
Verifying - enter aes-256-cbc encryption password: | |
U2FsdGVkX19T5h74/9HOtWBX4WoIggVKksYf7L1WBso= | |
DECRYPT | |
$ echo "U2FsdGVkX19T5h74/9HOtWBX4WoIggVKksYf7L1WBso=" | openssl aes-256-cbc -a -d -salt | |
enter aes-256-cbc decryption password: | |
my secret message |
OlderNewer