Skip to content

Instantly share code, notes, and snippets.

@flandrade
flandrade / automatically-add-icalendar-events.md
Last active September 25, 2025 22:12
Automatically Add iCalendar Events (.ics) to Calendars

Automatically Add iCalendar Events (.ics) to Calendars

Do you want to create a calendar event so that you can display it on an iPhone's calendar app or in Google Calendar? This can be done by using iCalendar events RFC 5545 as part of the following workflow:

  1. The user signs up for an event online.
  2. The user receives the iCalendar file as an attachment in the email.
  3. The .ics file contains information for the event at a specific time and date.
@DaleMckeown
DaleMckeown / select2-bootstrap-v4.0.0-Beta.css
Last active January 26, 2018 11:27
Select2 Bootstrap theme for Bootstrap Beta. SCSS and CSS versions (compiled to my Bootstrap specs)
.select2-container--bootstrap {
display: block;
/*------------------------------------* #COMMON STYLES
\*------------------------------------*/
/**
* Search field in the Select2 dropdown.
*/
/**
* No outline for all search fields - in the dropdown
* and inline in multi Select2s.
@DaleMckeown
DaleMckeown / select2-bootstrap-v4.0.0-alpha.6.scss
Last active July 21, 2017 08:52
Modification of judetucker's select2-bootstrap-v4.0.0-alpha.6.scss to fix Bootstrap border-radius issue. This uses the Bootstrap border-radius mixin to ensure $enable-rounded is honored.
//
// Mixins - we need to override the Bootstrap mixins to set border-radius to 0 if $enable-rounded is false.
// --------------------------------------------------
@mixin border-radius($radius: $border-radius) {
@if $enable-rounded {
border-radius: $radius;
}
@else {
@EdnaldoNeimeg
EdnaldoNeimeg / bootstrap4-editable.js
Last active March 25, 2021 08:54
Fix x-editable for Bootstrap 4 - Using Tether
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@judetucker
judetucker / select2-boostrap-v4-alpha-6.scss
Created April 6, 2017 22:29
Select2 Boostrap 4 Stylesheet
//
// Variables
// --------------------------------------------------
// Variables directly translating Bootstrap variables
// -------------------------
$s2bs-border-radius-base: $border-radius !default;
$s2bs-border-radius-large: $border-radius-lg !default;
$s2bs-border-radius-small: $border-radius-sm !default;
@benck
benck / x-editable-bs4.js
Last active January 21, 2021 08:44
A fix for x-editable to be compatible with bootstrap 4.0.0 alpha 5 and jQuery 3.1.1. Make sure you include Tether for bootstrap 4. (The button is changed to Fontawesome, you may change the $.fn.editableform.buttons to your desired buttons.)
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@JamoCA
JamoCA / IISRewrite_BlockAccessToIPHost.config
Last active May 2, 2016 21:11
IIS Rewrite Rule to abort remote attempts to request website using IP address.
<rewrite>
<globalRules>
<!-- IIS Rewrite Rule to abort remote attempts to request website using IP address.
http://gamesover2600.tumblr.com/post/127814740469/iis-rewrite-rule-to-block-access-to-ip-hostname -->
<rule name="Block Access to IP Host" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REMOTE_ADDR}" pattern="^(192.168.0.[0-9]{1,3})$" negate="true" />
<add input="{REMOTE_ADDR}" pattern="^(127.0.0.1)$" negate="true" />
<add input="{HTTP_HOST}" pattern="^\d+\.\d+\.\d+\.\d+" />
@JamoCA
JamoCA / stripControlCharsUDF.cfm
Last active May 2, 2016 21:12
ColdFusion UDF to strip all control characters from a string. (Tab, Enter & Carriage Return are ignored and list of ASCII Decimal codes can be passed to ignore others.)
/* 8/26/2015 Strips Control Characters (w/optional Filter)
https://en.wiktionary.org/wiki/Appendix:Control_characters
http://www.regular-expressions.info/unicode.html
8/27/2015 Updated to define all chars and use ReplaceList() */
function stripControlChars(s){
var excludeChars = "9,10,13"; /* Horizontal Tab, Line Feed, Carriage Return */
var controlChars = [chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), chr(7), chr(8), chr(9), chr(10), chr(11), chr(12), chr(13), chr(14), chr(15), chr(16), chr(17), chr(18), chr(19), chr(20), chr(21), chr(22), chr(23), chr(24), chr(25), chr(26), chr(27), chr(28), chr(29), chr(30), chr(31), chr(127), chr(128), chr(129), chr(130), chr(131), chr(132), chr(133), chr(134), chr(135), chr(136), chr(137), chr(138), chr(139), chr(140), chr(141), chr(142), chr(143), chr(144), chr(145), chr(146), chr(147), chr(148), chr(149), chr(150), chr(151), chr(152), chr(153), chr(154), chr(155), chr(156), chr(157), chr(158), chr(159), chr(160), chr(173), chr(847), chr(1807), chr(6158), chr(82
@JamoCA
JamoCA / WKHTMLTOPDF.cfm
Last active December 16, 2022 04:30
WKHTMLTOPDF ColdFusion Custom Tag - Converts multiple HTML fragments to PDF.
<CFSETTING ENABLECFOUTPUTONLY="Yes">
<!--- 4/2/2015 by SunStar Media http://www.sunstarmedia.com/ --->
<!--- more posts here: https://gamesover2600.tumblr.com/tagged/wkhtmltopdf --->
<CFPARAM NAME="Attributes.wkhtmltopdfEXEPath" DEFAULT="c:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe">
<CFPARAM NAME="Attributes.ShowDebug" DEFAULT="no"><!--- Yes/No Shows inline results. (default = no) --->
<CFPARAM NAME="Attributes.DebugVar" DEFAULT="WKHMLTOPDF_Result" TYPE="variableName"><!--- Variable name w/PDF generation data. Optional --->
<CFPARAM NAME="Attributes.TimeOut" DEFAULT="60" TYPE="integer"><!--- CFExecute Timeout (Default = 60) --->
<CFPARAM NAME="Attributes.HeaderURL" DEFAULT=""><!--- Publicly accessible URL. Optional --->
<!--- TODO: Add HeaderSpacing --->
@JamoCA
JamoCA / sanitizeFileName.cfm
Last active February 16, 2023 18:50
ColdFusion UDF to sanitize filename & remove illegal characters & symbols that are incompatible/invalid when used with different languages, OS and devices.
<cfscript>
/* SanitizeFilename - Sanitize a string to be safe for use as a filename by removing directory paths and invalid characters.
SanitizeFilename(filename, rulesList, replacementCharacter);
rulesList: convertspacestounderscores, convertspacestodashes, convertdashtounderscore, convertunderscoretodash
rulesList: nodash, forcelowercase, forceuppercase
replacementCharacter: default = ""
NOTE: Lowercases extension
Written by SunStar Media https://www.sunstarmedia.com/
3/18/2015 Initial UDF
4/25/2018 Updated w/optional ICU4J support (to convert foreign characters to Latin-ASCII)