This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { integer, sqliteTableCreator, text } from 'drizzle-orm/sqlite-core' | |
const sqliteTable = (tenant?: string) => | |
sqliteTableCreator(name => (tenant ? `${tenant}_${name}` : name)) | |
export const users = sqliteTable()('users', { | |
id: integer('id', { mode: 'number' }).primaryKey({ autoIncrement: true }), | |
name: text('name'), | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check if 2 circles collide | |
* | |
* Takes velocities and alters them as if the coordinate system they're on was rotated | |
* | |
* @param Number | p1x | x coordinate of the first particle | |
* @param Number | p1y | y coordinate of the first particle | |
* @param Number | r1 | radius of the first particle | |
* @param Number | p2x | x coordinate of the second particle | |
* @param Number | p2y | y coordinate of the second particle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { app, h } from "hyperapp"; | |
import { Stateful } from './helpers' | |
/* Working example, https://codepen.io/sergey-shpak/pen/maMopd */ | |
// --- STATEFUL COMPONENT --- | |
// Don't use arrow functions for stateful components/actions | |
// Since context is linked to it's definition context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usage: | |
// | |
// Copy the 2 functions below into your theme. | |
// | |
// Add the 'auto_install' attribute when registering the plugins: | |
// | |
// array( | |
// 'name' => 'Some Plugin', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
*------------------------------------------------------------------------------------------------ | |
* Determine if string is serialized | |
*------------------------------------------------------------------------------------------------ | |
* | |
*/ | |
function string_is_serialized($str) | |
{ |