List of helpful shortcuts for faster coding
| import ExpoModulesCore | |
| import SwiftUI | |
| public class SwiftuiViewModule: Module { | |
| public func definition() -> ModuleDefinition { | |
| Name("SwiftuiForm") | |
| View(SwiftuiView.self) { | |
| Prop("name") { (view, name: String) in | |
| view.name = name | |
| } | 
| package expo.modules.jetpackcomposeview | |
| import android.content.Context | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.core.animateFloatAsState | |
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.padding | |
| import androidx.compose.material3.* | 
| const ContentVideo = ({ videoId, on }) => { | |
| const player = useRef(); | |
| useEffect(() => { | |
| player.current = new YTPlayer('#' + videoId); | |
| player.current.load(videoId); | |
| }, []); | |
| useEffect(() => { | |
| if (!on) { | 
| import '../scss/admin.scss'; | 
| var gulp = require('gulp'); | |
| var $ = require('gulp-load-plugins')(); | |
| var del = require('del'); | |
| var sprite = require('css-sprite').stream; | |
| var runSequence = require('run-sequence'); | |
| var browserSync = require('browser-sync'); | |
| var reload = browserSync.reload; | |
| var lost = require('lost'); | |
| var appConfig = { | 
Pure SASS-adaption of Lea Verou's contrast-ratio javascript. Can be useful when eg. generating colored buttons from a single supplied color as you can then check which out of a couple of text colors would give the best contrast.
This script currently lacks the support for alpha-transparency that Lea supports in her script though.
In addition to the color-contrast adaption there's also some math methods that were needed to be able to calculate the exponent of a number and especially so when the exponent is a decimal number. A 2.4 exponent is used to calculate the luminance of a color and calculating such a thing is not something that SASS supports out of the box and not something I found a good pure-SASS script for calculating and I much prefer pure-SASS over ruby extensions. The math methods might perhaps be unecessary though if you're running Compass or similar as they may provide compatible math methods themselves.
Normal usage: `color: pick_best_color(#f00
| stylus: | |
| compress: true | |
| path: ./path/to/styl | 
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" | 
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |