Skip to content

Instantly share code, notes, and snippets.

Cerys Williams c3ry5

  • London, United Kingdom
Block or report user

Report or block c3ry5

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
View macsetup.sh
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Apps
apps=(
java
docker
View countdown.css
body {
background: #000;
}
.countdown {
background: #000;
color: #fff;
display: table;
margin: 0 auto;
text-align: center;
font-family: arial;
View userguid.js
var guid = function() {
var nav = window.navigator;
var screen = window.screen;
var guid = nav.mimeTypes.length;
guid += nav.userAgent.replace(/\D+/g, '');
guid += nav.plugins.length;
guid += screen.height || '';
guid += screen.width || '';
guid += screen.pixelDepth || '';
@c3ry5
c3ry5 / SaveforWebSP.jsx
Last active Jan 10, 2019
A script to export images in photoshop with max with and file size
View SaveforWebSP.jsx
//SaveforWebSP.jsx
var docRef = activeDocument;
var outputFolder = docRef.path;
var segments = app.activeDocument.name.split(".");
segments.splice(segments.length - 1, 1);
var docName = segments.join(".");
var fileName = prompt("Please Enter a file name without extension?", docName);
var safeFileName = fileName.replace(/[^A-Z0-9]+/ig, "_");
@c3ry5
c3ry5 / Dockerfile
Created Dec 19, 2018
Basic Docker Setup for php & MySql with the dependancies for Xenforo
View Dockerfile
FROM php:7.1.2-apache
RUN apt-get update && \
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install gd
RUN docker-php-ext-install mysqli
@c3ry5
c3ry5 / detect-webapp.js
Last active Nov 4, 2018
detect if the website has been saved as a webapp
View detect-webapp.js
const webappDetect = () => ("standalone" in window.navigator) && window.navigator.standalone;
@c3ry5
c3ry5 / ga-error-tracking.js
Last active Nov 4, 2018
crossbrowser tracking js errors using google analytics
View ga-error-tracking.js
window.onerror = (message, filename, lineno, colno, error) => {
function stack() {
return (`${(error.stack).replace(/(\r\n|\n|\r)/gm," ")} in ${navigator.userAgent}`)
}
function nostack() {
return (`${message} on line ${lineno} for ${filename} in ${navigator.userAgent}`)
}
@c3ry5
c3ry5 / read.cookie.js
Last active Nov 4, 2018
Read and write cookies
View read.cookie.js
@c3ry5
c3ry5 / mergeObjects.es6.js
Last active Nov 4, 2018
Merging two js objects without jquery
View mergeObjects.es6.js
Object.prototype.assign = Object.assign || function(obj1, obj2) {
var obj3 = obj1;
for (var attrname in obj2) {
if (typeof(obj2[attrname]) !== 'function') {
obj3[attrname] = obj2[attrname];
}
}
return obj3;
@c3ry5
c3ry5 / serialize.es6.js
Last active Nov 4, 2018
A script to serialize a form using native js - https://codepen.io/anon/pen/VVwopj
View serialize.es6.js
window.serialize = {
simple(form) {
const formel = document.querySelectorAll(form);
const inputs = formel[0].querySelectorAll("input, select, textarea");
const obj = {};
let key;
for (key in inputs) {
if (inputs[key].tagName) {
if (inputs[key].type === "checkbox") {
obj[inputs[key].name] = inputs[key].checked === true ? inputs[key].value : false;
You can’t perform that action at this time.