Skip to content

Instantly share code, notes, and snippets.

@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 10, 2024 09:39 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@rtablada
rtablada / controllers.md
Last active August 29, 2015 14:00
My thoughts on a CMF

Admin Controller

The admin controller will extend the Laravel base controller and be crazy smart about things. If you return a string or view object, then it will be injected in the content of the BlockCMF admin layout. This allows you to program like a usual Laravel controller with your own internal layouts, sub-views, view composers, and everything and not having to be bothered about remembering to follow some weird API to make sure you inject your view into the layout. Just extend the AdminBaseController and go to town!

API Controllers (Advanced mutations to be implemented later)

@krzkaczor
krzkaczor / fme.js
Created May 16, 2015 23:51
Fast modular exponentiation in Java Script
/**
* Fast modular exponentiation for a ^ b mod n
* @returns {number}
*/
var fastModularExponentiation = function(a, b, n) {
a = a % n;
var result = 1;
var x = a;
while(b > 0){
@trvswgnr
trvswgnr / fetchJson.test.ts
Last active July 24, 2024 11:18
nice lil typescript fetch wrapper with errors as values
import { describe, it, expect, spyOn } from "bun:test";
import { fetchJson } from "./fetchJson";
class MockResponse {
static instanceCount = 0;
constructor(
public readonly ok: boolean,
private jsonSuccess: boolean | "bad parse",
) {
MockResponse.instanceCount++;