Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Fuel Usage and Trip Cost Calculator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<h1 class="mb-3">Fuel Usage and Trip Cost Calculator</h1>
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active May 18, 2024 18:32
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@Spellhammer
Spellhammer / urlparamexistscondition
Last active August 15, 2022 10:30
Check for presence of URL parameter condition for Oxygen
if( function_exists('oxygen_vsb_register_condition') ) {
global $oxy_condition_operators;
// Condition to check if a URL parameter is present.
oxygen_vsb_register_condition('URL Param Exists', array('options'=>array(), 'custom'=>true), array('--'), 'oxy_url_param_exists_callback', 'Other');
function oxy_url_param_exists_callback($value, $operator) {
if( isset($_GET[$value]) && $_GET[$value] ) {
@mimonelu
mimonelu / invert.js
Last active March 23, 2024 04:01
Bookmarklet to invert web page color.
javascript:(()=>{const s=document.documentElement.style;s.backgroundColor='black';s.filter='invert(100%)';})();void 0;
@learncfinaweek
learncfinaweek / gist:4121263
Created November 20, 2012 21:25
Application.cfc

By now you've learned the basics of ColdFusion, script vs. tag syntax, scopes, how to deal with data, and even some code-reuse techniques. You're now able to write something useful, so it's time we introduce you to the Request Lifecycle.

You see, when someone requests a ColdFusion page, CF doesn't just start executing your code. There are several events that first take place, which you can be waiting for, and to which you can react. This is not strictly necessary, but you'll find that any complex application will eventually want to make use of some or all of these features, so it's best that you know about them. In order to react to these events, you need to have an Application.cfc file. ColdFusion has designated Application.cfc as a special component that it will automatically look for, and in which we can put our event listeners for request lifecycle events.

A Note on Terminolog
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@randomweapon
randomweapon / numberToLetter.cfm
Created May 22, 2012 01:06
coldfusion function to convert a number into a letter similar to how excel columns work.
<!---
Function Name : numberToLetter()
Author : Ryan Spencer
Created : 22/05/2012
General Notes : convert a number into a letter similar to how excell columns work.
Function in :
number (int)
@martinbean
martinbean / WHOIS look-up bookmark
Created October 26, 2010 10:06
Want to quickly do a WHOIS look-up of the domain of the current website you're browsing? Simple save the following snippet as a bookmark in your favourite WebKit-enabled web browser...
javascript:var loc=window.location.host;window.location.href='http://whois.domaintools.com/'+loc;