Skip to content

Instantly share code, notes, and snippets.

View kylesloper's full-sized avatar
Building new projects

kylesloper

Building new projects
View GitHub Profile
# Example encoding of an email message in JSON
{
headers: [ # in an array since order matters
{ name: 'Subject', value: 'An email' },
{ name: 'Date', value: 'Thu, 4 Mar 2010 15:35:32 -0800' },
{ name: 'From', value: 'george@foo.com' },
{ name: 'To', value: 'paul@goo.com' }
{ name: 'Sender', value: 'paul@goo.com' }
{ name: 'Reply-to', value: 'paul@goo.com' }
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@Zilleabbas10
Zilleabbas10 / DeploymentOnAppStoreAndPlayStore.txt
Last active August 11, 2021 12:23
Deployment on App Store and Play Store
Deployment on App Store and Play Store
Deployment for App Store:
Apple TestFlight App upload(iTunes connect)
1. 1st you have to integrate developer account to Xcode.
2. Then open your app through iOS platform file name with xcworkspace extension in Xcode.
3. Sign the certificates to your app and increase your version if needed.
4. Clean your build and and then make a build. If any error occur then resolve them and repeat this process until and unless build succeeded.
5. After that make archive of app which would be then ready for upload for test purpose as well as a new version.
@tech4him1
tech4him1 / creating-backend.md
Created August 23, 2018 22:08
Netlify CMS v2.0 backend methods.
title weight group
Creating a CMS Backend
30
reference

Netlify CMS exposes a window.CMS global object that you can use to register custom backends. The same object is also the default export if you import Netify CMS as an npm module. The available backend extension methods are:

  • registerBackend: lets you register a custom backend. The CMS expects you to pass it an ES6 class or other object which it can call new BackendClass() on.
@benald
benald / nunjucks-multilevel-navigation
Created November 29, 2018 00:45
Nunjucks Multi Level Navigation Template
// JSON Structure
[{
"title": "Home",
"name": "index"
},
{
"title": "Find a service",
"name": "find a service"
},
{
@arlomba
arlomba / tailwind.js
Created January 30, 2019 23:07
Tailwind CSS config using Material Design colors
/*
Tailwind - The Utility-First CSS Framework
A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink),
David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger).
Welcome to the Tailwind config file. This is where you can customize
Tailwind specifically for your project. Don't be intimidated by the
length of this file. It's really just a big JavaScript object and
@bueltge
bueltge / http-status-codes-explained.md
Last active June 13, 2023 13:16
HTTP Status Codes Explained

HTTP Status Codes Explained

In a Client-Server architecture, you (the Client end) receives various types of responses and to identify each of them, these HTTP Status Codes are divided into various categories. Each status code is a 3 digit number of which, the first digit determines the category and the rest two digits really gives the meaning to these HTTP Status Codes.

@bholtbholt
bholtbholt / nested-stores.js
Created February 6, 2022 20:25
How to handle accessing nested data in Svelte stores using curried functions
// $list has a nested structure like:
// lists: [
// {
// "id": "TODO-ns88qrJDVXizlF0l",
// …properties omitted for brevity
// "cards": [
// {
// "id": "6OPzS6B6WoBT0J_EGqUEy",
// "listId": "TODO-ns88qrJDVXizlF0l",
// …properties omitted for brevity
@jimniels
jimniels / netlify-analytics-digest.js
Last active October 2, 2022 17:08
Example code that pulls data from the Netlify Analytics API (unofficial, v2) and creates HTML that can be sent in an email. Read more: https://blog.jim-nielsen.com/2022/netlify-analytics-email-digest/
const fetch = require("node-fetch");
const now = Date.now();
const oneDayAgo = now - 24 * 60 * 60 * 1000;
const { NETLIFY_BLOG_SITE_ID, NETLIFY_TOKEN } = process.env;
exports.handler = async function (event) {
try {
// Fetch the data
const sources = await fetchNetlify(
`ranking/sources?from=${oneDayAgo}&to=${now}&limit=100&timezone=-0700&resolution=hour`
@sinedied
sinedied / fastread.js
Last active June 5, 2022 15:29
Fast reading experimentation
// Usage: fastRead('Lorem ipsum dolor sit amet')
function fastRead(text, left = '<b>', right = '</b>') {
return text?.replace(/[A-Za-zÀ-ÖØ-öø-ÿ0-9]+/gm, (word) => {
const split = word.length > 3 ? Math.ceil(word.length / 2) : 1;
return left + word.substring(0, split) + right + word.substring(split);
});
}