Skip to content

Instantly share code, notes, and snippets.

View Lissy93's full-sized avatar
:bowtie:
Stuck in an infinite loop

Alicia Sykes Lissy93

:bowtie:
Stuck in an infinite loop
View GitHub Profile
@Lissy93
Lissy93 / gulpfile.js
Last active April 2, 2018 08:15
An over-commented example of a Gulp setup for Express Node apps, with live reload from browser-sync and nodemon as well as a complete build setup using various modules
/**
* Created by alicia.sykes on 17/07/2015.
* To run script run "gulp" in the command line
* To just watch files run "gulp watch"
* To just clean the public directory run "gulp clean"
*/
/* Include the necessary modules */
var gulp = require('gulp');
var gutil = require('gulp-util'); // For logging stats and warnings

Keybase proof

I hereby claim:

  • I am lissy93 on github.
  • I am aliciasykes (https://keybase.io/aliciasykes) on keybase.
  • I have a public key ASBfI454lYDXt78y3STYeJn9rCbjj0rKEttcrS_Rg2qX9go

To claim this, I am signing this object:

@Lissy93
Lissy93 / block-stack-verification.txt
Created August 17, 2019 22:40
Just verifying myself, not much to see here. If your interested, Blockstack is a decentralized computing network and app ecosystem that supposedly puts users in control of their identity and data. I thought it sounded like a pretty cool concept, so hope to see it used in the future
Verifying my Blockstack ID is secured with the address 1NWgGVfEt2cvAV8uAVrPnVJysmubfXskuS https://explorer.blockstack.org/address/1NWgGVfEt2cvAV8uAVrPnVJysmubfXskuS
@Lissy93
Lissy93 / json2array.js
Last active November 11, 2019 18:09
A simple function to convert any flat JSON object to an array of keys and values
/**
* Copyright Alicia Sykes <https://aliciasykes.com>
* Licensed under MIT X11: https://git.io/Jew4i
*
* Converts a given JSON object into an array
* Where { key: 'Value' } --> ['key': 'value']
* @param json - the object to be converted
*/
const json2array = (json) => {
@Lissy93
Lissy93 / accessibility-steps.ts
Last active November 11, 2019 18:15
An automated testing script, that checks for accessibility issues. This file can just be dropped into your Protractor, Chai and Cucumber test environment.
// Copyright Alicia Sykes <https://aliciasykes.com>. Licensed under MIT X11: https://git.io/Jew4i
import { binding, when } from "cucumber-tsflow";
import { browser, by, element, protractor } from "protractor";
import { expect } from "chai";
import { Config } from "../utils/config";
import { DomUtil } from "../utils/domUtil";
@binding()
class AccessibilitySteps {
@Lissy93
Lissy93 / key-mirror.ts
Last active November 11, 2019 18:19
Constructs an enumeration with keys equal to their value
/**
* Copyright Alicia Sykes <https://aliciasykes.com>
* Licensed under MIT X11: https://git.io/Jew4i
*
* Constructs an enumeration with keys equal to their value.
* @param {object} obj
* @return {object}
*/
export function keyMirror(originObj: object) {
if (typeof originObj !== 'object')
@Lissy93
Lissy93 / gen-unique.ts
Created December 19, 2019 11:38
A simple TypeScript function: Generates a random alpha-numeric ID with length of N
/**
* A function that generates a unique ID
* Made up of N random characters, N numbers from end of timestamp, and shuffled using Math.random
*/
export default (totalLen: number = 5) => {
// 1. Generate Random Characters
const letters = (len: number, str: string = ''): string => {
const newStr = () =>
String.fromCharCode(65 + Math.floor(Math.random() * 26));
return len <= 1 ? str : str + letters(len - 1, str + newStr());
@Lissy93
Lissy93 / keep-mouse-movin.sh
Created December 16, 2019 10:26
Quick script to periodically move the mouse. Many uses, such as avoiding Suspend to RAM Timeout, or more realistically keep status set to active while working from home 😉
# The mouse pointer will move around its current position on the screen, i.e. around any position
# on the screen where you place the pointer. However, if you prefer it to move around the centre
# of the screen then change mousemove_relative to mousemove in the xdotool command below.
# LENGTH is the amount of px the mouse will move
# 0 = not moving at all, 1 = tiny movement, 100 = giant movement
LENGTH=50
# DELAY os the number of seconds, between movements
DELAY=5
@Lissy93
Lissy93 / Credit-card-validator.py
Last active October 27, 2022 17:15
Simple Python script that can validate wheather a given credit/ debit card number is of a valid format
'''
Date : 22 Oct 2012
@author : Alicia Sykes
'''
#Remove Bad Characters
def validate(cardNumber):
validCardNumber = ""
for number in cardNumber:
if (ord(number)>=48 and ord(number)<=57): validCardNumber += str(number)

The MIT License (MIT)

Copyright (c) Alicia Sykes alicia@aliciasykes.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: