Skip to content

Instantly share code, notes, and snippets.

View atomize's full-sized avatar
🎹
♩♩

Berti atomize

🎹
♩♩
View GitHub Profile
@olanod
olanod / templates.js
Last active March 8, 2025 17:37
Simple template loader. A global object that loads and caches templates.
const templates = Object.create(null, {
load: {
value: async function(fileName) {
const url = new URL(fileName,
document.currentScript && document.currentScript.src || location.href)
if (url in this) return this[url]
// fetch and parse template as string
let template = await fetch(url)
template = await template.text()
template = new DOMParser().parseFromString(template, 'text/html')
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
@rascode
rascode / GASApis.js
Created December 2, 2016 01:01
Google Apps Script Library
//Access the Spreadsheet - Declare globally
var ssid = ScriptProperties.getProperty('ssid'); //Spreadsheet ID. Value has been stored as a property
var ss = SpreadsheetApp.openById(ssid); //Opens the Spreadsheet using the stored property Spreadsheet ID
//Create variables for known sheets and all sheets
var iosSheet = getValueOfSheetByName("iOS"); //The iOS sheet
var gasSheet = getValueOfSheetByName("GAS"); //The Google Apps Script sheet
var allSheets = getValueOfAllSheets(); //All Sheet Values
@xem
xem / readme.md
Last active April 18, 2025 20:19
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@noelboss
noelboss / git-deployment.md
Last active May 5, 2025 08:21
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@rafaelstz
rafaelstz / get.js
Last active October 6, 2023 14:35
AJAX GET and POST with pure Javascript
// Exemplo de requisição GET
var ajax = new XMLHttpRequest();
// Seta tipo de requisição e URL com os parâmetros
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true);
// Envia a requisição
ajax.send();
// Cria um evento para receber o retorno.
@theplatapi
theplatapi / gist:0a7d789afc8028a3c20b
Last active November 26, 2023 05:55
Draw a rectangle in Cesium with shift-click-drag
var viewer = new Cesium.Viewer('cesiumContainer', {
targetFrameRate: 60,
homeButton: false,
sceneModePicker: false,
navigationHelpButton: false,
baseLayerPicker: false,
clock: new Cesium.Clock({
startTime: Cesium.JulianDate.fromIso8601('1880-01-01'),
currentTime: Cesium.JulianDate.fromIso8601('1880-01-01'),
stopTime: Cesium.JulianDate.fromIso8601("2013-12-01"),
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 5, 2025 01:35
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@mramato
mramato / EntityModelColor.js
Created June 24, 2015 21:59
Cesium example of coloring a model loaded with the Entity API
var viewer = new Cesium.Viewer('cesiumContainer', {
infoBox : false,
selectionIndicator : false
});
var entity = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-123, 44, 10),
model : {
uri : '../../../Specs/Data/Models/Box/CesiumBoxTest.gltf',
minimumPixelSize : 128
@chrismdp
chrismdp / s3.sh
Last active January 23, 2025 09:26
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1