Skip to content

Instantly share code, notes, and snippets.

@tim545
tim545 / lg-jquery-app-struct.md
Last active April 1, 2025 02:54
Structuring a large jQuery application

Structuring a large jQuery application

This document assumes you are building a traditional backend-heavy application as opposed to a frontend-heavy appliction which would typically use a framework like Angular or React. The use of these frameworks make this document irrelevant, however also require a change to your application architecture and a much larger overhead in order to get content onto a page, so as a simple way to build interactive web content a simple jquery based js stack will do fine.

Directory structure

It's important you use a directory structure which is impartial to your development environment, chosen server language (Python v. Java v. C# ...), and styling framwork (Twitter Bootstrap etc). This layer of separation means you can swap out the styles or the backend with minimal changes to the Js, simple and maintainable.

Here's an example from the project root:

@pamelafox
pamelafox / GithubClient.gs
Created May 12, 2017 20:51
Google Apps Script for committing a file to Github Repo
/* A bare-bones GithubClient, just used for commits */
function GithubClient(owner, repo, username, passwordOrToken) {
this.owner = owner;
this.repo = repo;
this.username = username;
this.passwordOrToken = passwordOrToken;
}
/*
@dreamsparkx
dreamsparkx / More-links.txt
Last active April 4, 2025 09:15
Install Apache, PHP, MySQL and phpMyAdmin on Mac OS X
@CodingDoug
CodingDoug / README.md
Last active December 17, 2022 10:23
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
@Aerodos12
Aerodos12 / Duty.lua
Created January 14, 2018 21:40 — forked from anonymous/Duty.lua
GunScripts, AI and GameServer
return function()
--[[
Basic Monster by ArceusInator
Information:
Configurations.MaximumDetectionDistance (default 200)
The monster will not detect players past this point. If you set it to a negative number then the monster will be able to chase from any distance.
Configurations.CanGiveUp (default true)
@gaearon
gaearon / index.html
Last active April 1, 2025 01:48
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active April 27, 2025 02:09
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

var pageSpeedApiKey = '';
var pageSpeedMonitorUrl = '';
function monitor() {
var desktop = callPageSpeed('desktop', pageSpeedMonitorUrl);
var mobile = callPageSpeed('mobile', pageSpeedMonitorUrl);
var desktopVitals = getVitals(desktop);
var mobileVitals = getVitals(mobile);

Fix for FOUC :

At the top of your HTML:

<!doctype html>
<html>
<head>
    <style>html{visibility: hidden;opacity:0;}</style>