Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
🚀 Coding Awesome Stuff

Alicia Sykes Lissy93

:octocat:
🚀 Coding Awesome Stuff
View GitHub Profile
@Lissy93
Lissy93 / README.md
Last active Aug 11, 2021
CloudFlare Worker for Dashy Backup and Restore
View README.md

This is the code for the backup / restore server used by Dashy. For more info, see Dashy Cloud Sync Docs.

All data needs to be encrypted before being sent to the backend. In Dashy, this is done in CloudBackup.js, using crypto.js's AES method, using the users chosen password as the key.

Getting Started

  1. Install Wrangler CLI Tool: npm i -g @cloudflare/wrangler
  2. Log into Cloudflare account: wrangler login
  3. Create a new project: wrangler generate my-project
  4. Install dependencies: cd my-project && npm i
  5. Populate wrangler.toml
@Lissy93
Lissy93 / Example 1 - Getting Started - conf.yml
Last active May 9, 2022
Example Config Files for Dashy
View Example 1 - Getting Started - conf.yml
---
# Page meta info, like heading, footer text and nav links
pageInfo:
title: Dashy
description: Welcome to your new dashboard!
navLinks:
- title: GitHub
path: https://github.com/Lissy93/dashy
- title: Documentation
path: https://dashy.to/docs
@Lissy93
Lissy93 / Credit-card-validator.py
Last active Jul 26, 2020
Simple Python script that can validate wheather a given credit/ debit card number is of a valid format
View Credit-card-validator.py
'''
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)
@Lissy93
Lissy93 / emoji-list.md
Last active May 1, 2021 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View emoji-list.md
  • 😄 :smile:
  • 😆 :laughing:
  • 😊 :blush:
  • 😃 :smiley:
  • 😀 :grinning:
  • 😏 :smirk:
  • 😍 :heart_eyes:
  • 😘 :kissing_heart:
  • 😚 :kissing_closed_eyes:
  • 😳 :flushed:
@Lissy93
Lissy93 / gen-unique.ts
Created Dec 19, 2019
A simple TypeScript function: Generates a random alpha-numeric ID with length of N
View gen-unique.ts
/**
* 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 Dec 16, 2019
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 😉
View keep-mouse-movin.sh
# 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 / json2array.js
Last active Nov 11, 2019
A simple function to convert any flat JSON object to an array of keys and values
View json2array.js
/**
* 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 / block-stack-verification.txt
Created Aug 17, 2019
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
View block-stack-verification.txt
Verifying my Blockstack ID is secured with the address 1NWgGVfEt2cvAV8uAVrPnVJysmubfXskuS https://explorer.blockstack.org/address/1NWgGVfEt2cvAV8uAVrPnVJysmubfXskuS
@Lissy93
Lissy93 / key-mirror.ts
Last active Nov 11, 2019
Constructs an enumeration with keys equal to their value
View key-mirror.ts
/**
* 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 / tfl-stations.json
Last active May 22, 2019
A list of all London Underground and DLR stations, along with their TLA codes 🚆
View tfl-stations.json
[
{
"tla":"ABR",
"name":"Abbey Road"
},
{
"tla":"ACT",
"name":"Acton Town"
},
{