Skip to content

Instantly share code, notes, and snippets.

View NoMan2000's full-sized avatar

Michael Ryan Soileau NoMan2000

  • Surge Forward
  • Reno, Nevada
View GitHub Profile
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);
<?php
/**
* Class CachedPDOStatement
*
* CachingIterator for a PDOStatement
*/
class CachedPDOStatement extends CachingIterator
{
private $index;
# https://github.com/causes/scss-lint/tree/master/lib/scss_lint/linter
exclude: 'app/assets/stylesheets/settings/*'
linters:
BorderZero:
enabled: true
ColorKeyword:
enabled: false
Comment:
@NoMan2000
NoMan2000 / apache ssh keys
Last active August 29, 2015 14:27 — forked from phedoreanu/apache ssh keys
Setting up automatic php git pulls
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R ubuntu:www-data /var/www/.ssh
# one problem here is I do not know who the exec command is executing as.
sudo -u ubuntu ssh-keygen (empty passphrase)
sudo -u ubuntu ssh -T [email protected]
# this adds git to the recognized list of /var/www/.ssh/known_hosts
# paste public key into repo manager
cd (git repo)
sudo -u apache git pull origin branch
<?php
/**
* GitHub webhook handler template.
*
* @see https://developer.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@NoMan2000
NoMan2000 / openssl.md
Last active October 10, 2024 12:03 — forked from zhiguangwang/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@NoMan2000
NoMan2000 / Alert.vue
Created April 7, 2017 23:40 — forked from martinlindhe/Alert.vue
jasmine + karma for vue test
<style>
.Alert {
padding: 2em;
}
.Alert-Success {
border: 10px solid green;
}
.Alert-Error {
border: 10px solid red;
}