Skip to content

Instantly share code, notes, and snippets.

Lewis Cowles Lewiscowles1986

Block or report user

Report or block Lewiscowles1986

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / nextcloud.sh
Created Aug 11, 2018
Testing Nextcloud using Docker
View nextcloud.sh
#!/bin/bash
mkdir -p ~/nextcloud
docker run -t -d --restart=always --name=nextcloud --publish 7000:80 --volume $PWD/nextcloud:/var/www/html:z nextcloud
@Lewiscowles1986
Lewiscowles1986 / onlyoffice.sh
Created Aug 11, 2018
Testing Onlyoffice with nextcloud
View onlyoffice.sh
#!/bin/bash
mkdir -p ~/onlyoffice
docker run -i -t -d --name=onlyoffice -p 7050:80 \
--volume ~/onlyoffice/logs:/var/log/onlyoffice:z \
--volume ~/onlyoffice/data:/var/www/onlyoffice/Data:z \
--volume ~/onlyoffice/lib:/var/lib/onlyoffice:z \
--volume ~/onlyoffice/db:/var/lib/postgresql:z onlyoffice/documentserver
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active Apr 17, 2019
Playstation 2 EU USB "The Buzz" controller
View README.md

"The Buzz" Playstation 2 EU USB controller

Using tool "Simple HID Write"

  • W: Write
  • R: Read
W 00 {FF} 00 00 00 // controller 1 red light activate
W 00 {00} 00 00 00 // controller 1 red light deactivate
@Lewiscowles1986
Lewiscowles1986 / script.js
Created May 20, 2018
Anonymous Upload images to Imgur V3 JS
View script.js
var ImgurAPIKey = 'YEAH-IM-NOT-GIVING-THAT';
window.addEventListener('paste', function(e) {
function eventPreventDefault(e) {
e.preventDefault();
}
function getClipboardData(e) {
return window.clipboardData || e.clipboardData;
}
@Lewiscowles1986
Lewiscowles1986 / script.js
Created Apr 27, 2018
Prev Next JS injection
View script.js
/*
* Used via https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
* to embed JS in all web-pages that are compliant to enable keyboard-navigation of blog posts
*/
window.addEventListener('keydown', function(e) {
//console.log(e);
switch(e.key) {
case 'ArrowLeft':
if(document.querySelector('a[rel="prev"]')) {
document.querySelector('a[rel="prev"]').click();
View 73301312-62b8-49b4-a0dc-43b9d077c283.desktop
[Desktop Entry]
Type=Action
ToolbarLabel[en_GB]=Convert MVE to MP4
ToolbarLabel[en]=Convert MVE to MP4
ToolbarLabel[C]=Convert MVE to MP4
Name[en_GB]=Convert MVE to MP4
Name[en]=Convert MVE to MP4
Name[C]=Convert MVE to MP4
Profiles=profile-zero;
@Lewiscowles1986
Lewiscowles1986 / sloyalty-livechat-whole-page-screenshot-prep.js
Created Mar 23, 2018
Moving SLoyalty & LiveChat out of my way for full-page screenies
View sloyalty-livechat-whole-page-screenshot-prep.js
var ensure_ss = function() {
let sel = '#sloyalty-display, #livechat-compact-container, .sloyalty-tab-widget[name="sloyalty-loyalty-widget-iframe"]';
[].slice.call(document.querySelectorAll(sel)).forEach(function(elem){
elem.style.position="absolute";
});
console.log('document mutation detected')
};
var observer = new MutationObserver(ensure_ss);
observer.observe(document, { childList: true });
document.addEventListener("DOMNodeInserted", ensure_ss, false);
View benchmark-pc.c
// Integer and float benchmark for Win32 and Win64
// Results are below main(), line 91
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
#include <sys/timeb.h>
#else
#include <sys/time.h>
#endif
@Lewiscowles1986
Lewiscowles1986 / benchmark-url-csv
Created Feb 13, 2018
Benchmark URL endpoint CSV
View benchmark-url-csv
#!/bin/bash
if [[ $# -lt 1 ]];
then echo "You need to pass a url!"
echo "Usage:"
echo "$0 {url}"
exit
fi
URL=$1
View SPARQL
PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#>
SELECT ?lastName ?firstName
FROM <http://jena.apache.org/tutorials/sparql_data/vc-db-1.rdf>
WHERE {
?x vCard:Family ?lastName .
?x vCard:Given ?firstName .
?x vCard:Family "Jones"
}
You can’t perform that action at this time.