Skip to content

Instantly share code, notes, and snippets.

@ccwasden
ccwasden / automateSandboxTesterEntry.js
Last active May 6, 2024 10:31
Automate rapid/fast creation of sandbox testers in itunesConnect
// Steps to use:
// 1. Go to itunesConnect > Users & Roles
// 2. Select "Testers" under the "Sandbox" header on the left
// 2. Open the console on your browser (eg. CMD-OPT-J)
// 3. Paste the code below (modified to your liking) into the console and hit enter
// 4. enter `createUser('desiredEmailAlias')` into the console and watch the user get created automatically
//
// NOTE: To create several users rapidly: in the console hit the up arrow, change the alias, and hit enter again. Repeat.
// Edit the user here to your liking
@ccwasden
ccwasden / Await+Threading.swift
Created April 27, 2020 22:39
Await+Threading
//
// Author: Chase Wasden
// Website: https://gist.github.com/ccwasden
// Licensed under MIT license https://opensource.org/licenses/MIT
//
import Foundation
import Combine
// Threading
@Rich-Harris
Rich-Harris / script.sh
Created September 16, 2018 02:23
10 second Svelte demo
echo "<button on:click='set({ count: count + 1 })'>{count}</button>" > App.html
npx svelte compile App.html --format iife --name App > App.js
echo "<div id=target></div>
<script src=App.js></script>
<script>
new App({
target,
data: { count: 0 }
@Rich-Harris
Rich-Harris / wishlist.md
Created November 9, 2018 13:40
Platform wishlist

Platform wishlist

An unconnected list of things it'd be nice to have in the platform. I may add to this over time

SVG 2

Is this ever going to happen? SVG 1.1 is really showing its age, and it feels like something browser vendors have long since stopped caring about

Cmd-F

@Rich-Harris
Rich-Harris / extensions.md
Last active May 6, 2024 10:29
What should be the canonical file extension for Svelte components?

So far, most of us have been writing Svelte components into .html files, with a few exceptions (Parcel users, for example, have additional constraints to work with). We're currently discussing whether this should change.

Once you've read the pros and cons, please vote!

.html

Pros:

  • It signals that you can use your existing HTML (and CSS) knowledge
  • Valid HTML is valid Svelte
@Rich-Harris
Rich-Harris / README.md
Last active May 6, 2024 10:29
Testing array.splice vs array.pop vs set.delete

You have an array. Its sort order doesn't matter. You want to remove an item from this array.

The obvious thing to do would be to use splice:

function remove(array, item) {
  const index = array.indexOf(item);
  array.splice(index, 1);
}
@Rich-Harris
Rich-Harris / lookup-vs-nested-foreach.js
Created June 29, 2020 17:44
lookup vs nested foreach
// re https://stackoverflow.com/questions/62621666/how-can-i-reliably-merge-objects-from-these-2-arrays-and-loop-the-resulting-arra/62623714?noredirect=1#comment110766294_62623714
function with_nested_for_each([a, b]) {
const result = [];
a.forEach(p => {
b.forEach(q => {
if (p.code === q.code) {
result.push(Object.assign({}, p, q));
}
@Rich-Harris
Rich-Harris / custom-element.js
Created June 20, 2018 18:59
Svelte with/without `customElement: true`
var hw = (function () {
'use strict';
function noop() {}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
@DashW
DashW / ScreenRecorder.cs
Last active May 6, 2024 10:27
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)
@ismailbaskin
ismailbaskin / turkce_isimler.sql
Last active May 6, 2024 10:27
Türkçe isim veritabanı
-- Turkce isimler sozlugu twitter : http://twitter.com/baskindev
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------