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
#!/bin/bash | |
# Production Docker Host Hardening Script v2 | |
# For Ubuntu Server 24.04 LTS (Noble) | |
# Suitable for both Kamal deployment and builder hosts | |
set -euo pipefail | |
IFS=$'\n\t' | |
# --- Constants --- |
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
# two different ways to implement a find_or_create for Ecto | |
find_or_create_user = fn user -> | |
case Repo.all(from u in users, where: u.id == ^user.id and u.email == ^user.email) do | |
[] -> | |
%User{} | |
|> User.changeset(user) | |
|> Repo.insert!() | |
_ -> | |
IO.puts "Already inserted" |
In your command-line run the following commands:
brew doctor
brew update
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
// origin: https://gist.github.com/tomhicks/6cb5e827723c4eaef638bf9f7686d2d8 , tomhicks/plink-plonk.js | |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ |
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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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 {NgModule} from '@angular/core'; | |
import {HomeComponent} from './home/home.component'; | |
import {AboutUsComponent} from './about-us/about-us.component'; | |
import {ContactComponent} from './contact/contact.component'; | |
import {UIRouterUpgradeModule} from "@uirouter/angular-hybrid"; | |
export const StaticPagesRoutes = { | |
states: [ | |
{ | |
name: 'home', |
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 {NgModule} from '@angular/core'; | |
import {HomeComponent} from './home/home.component'; | |
import {AboutUsComponent} from './about-us/about-us.component'; | |
import {ContactComponent} from './contact/contact.component'; | |
export class DependencyInjectionClass { | |
constructor(private _service: FictionalService) {} | |
resolve(route, state) { | |
//Get some fictional data with the id that's in the URL |
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 { Injectable } from '@angular/core'; | |
import { environment } from '../../../environments/environment'; | |
export interface ILoggerService { | |
info(value: any, ...rest: any[]): void; | |
log(value: any, ...rest: any[]): void; | |
warn(value: any, ...rest: any[]): void; | |
error(value: any, ...rest: any[]): void; | |
} |
Just a minimal CARTO.js example with the defalut Leaflet Control Geocoder.
Simply add the JS and CSS imports
<!-- Geocoder-->
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
NewerOlder