This file contains hidden or 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 { Component, Input } from '@angular/core'; | |
| import { FormsModule } from '@angular/forms'; | |
| //This slider has a 2 color dynamic background for the rail, | |
| //and a handle that enlarges when hovered. | |
| @Component({ | |
| selector: 'pretty-slider', | |
| standalone: true, | |
| imports: [FormsModule], | |
| template: ` |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <script type="text/javascript" defer="defer"> | |
| /** | |
| * @author Maurice Ferguson maurice.does.software@gmail.com | |
| * @version 0.5 | |
| * @since 2019-08-16 | |
| * @see https://gist.github.com/maurice-does-software/4fd0a574ddd74ef7f78a51f84292791a | |
| * @desc |
This file contains hidden or 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
| function validateDriversLicenseNumber(stateAbbrev, dln, consumer){ | |
| var stateDlnPatterns={ | |
| /* Each pattern string is either a function name or a partial regex. */ | |
| AK: {patterns:["\\d{1,7}"], human:"1 to 7 digits"}, | |
| AL: {patterns:["\\d{7}", "\\d{1,7}"], human:"1 to 7 digits"}, | |
| AR: {patterns:["\\d{9}"], human:"9 digits"}, | |
| AZ: {patterns:["[A-Z]{1}\\d{8}", "[A-Z]{2}\\d{3,6}", "\\d{9}"], human:"(1 letters then 8 digits) OR (2 letters then 3 to 6 digits) OR (9 digits)"}, | |
| CA: {patterns:["[A-Z]{1}\\d{7}"], human:"1 letters then 7 digits"}, |
This file contains hidden or 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
| @echo off | |
| rem This script is meant to automate as much as possible our interactions | |
| rem with an archaic, unscriptable Windows GUI app, | |
| rem which downloads data dumps needed for a *nix server app. | |
| rem It assumes Windows is running in a VM with no ssh/scp client | |
| rem but with a shared folder that the host OS can access. | |
| rem The echos at the end are just a handy reminder for myself | |
| rem so I don't have to search through my notes for server details. | |
| rem Config |
This file contains hidden or 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 | |
| #Allow numeric prefix to be set as an argument. | |
| #Can use `-` to pass through and still pass additional commands. | |
| if [ -n "$1" ] && [ "$1" != "-" ] | |
| then | |
| NUMERIC_PREFIX=$1 | |
| else | |
| NUMERIC_PREFIX='0001' | |
| fi |
This file contains hidden or 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
| /* | |
| Usage: | |
| To create a rotator for container element `#the-container`, rotating every 12 seconds, using class `foobar` to show: | |
| createQuoteRotator('#the-container',12,'foobar'); | |
| To create a rotator for the element `#blah` using the default 8 second interval and default class 'show' to show: | |
| createQuoteRotator('#blah'); | |
| To stop the timer of the second quote rotator on the page: | |
| window.clearInterval(window.quoteRotators[1].timer); | |
| */ |
This file contains hidden or 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
| #This method is meant to filter incoming parameters in the controller | |
| #before calling a model method like `update_attributes` with those parameters. | |
| def sanitize_params object, new_attrs | |
| new_attrs.keys.each do |k| | |
| #Remove keys for which there is no setter method. | |
| (new_attrs.delete(k) && next) if !object.respond_to?("#{k}=") | |
| #Remove keys holding datetimes that haven't changed substantially (more than just the seconds being truncated). | |
| if new_attrs[k] && object.respond_to?(k) && object.send(k).is_a?(Time) | |
| existing_value=object.send(k).utc.to_i+object.send(k).utc_offset | |
| new_attrs.delete(k) if new_attrs[k].to_time.to_i/120==existing_value/120 |
This file contains hidden or 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
| (function(){ | |
| function makeSticky(selector){ | |
| var $el =$(selector), | |
| elOffSetFromTop =$el.offset().top, | |
| elStickyOffSet =parseInt($el.attr('data-sticky-offset'))||0; | |
| var makeItStick=function(){ | |
| var windowOffSetFromTop=$(window).scrollTop(); | |
| if (windowOffSetFromTop+elStickyOffSet > elOffSetFromTop+10) { |
This file contains hidden or 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
| (function(){ | |
| var $navList =$('#scroll-bar ul'), | |
| $nextSectionLink=$('#next-section-link'); | |
| function updateNextSectionLink(){ | |
| var $activeNavItem=$navList.find('li.active'),//bootstrap scrollspy sets this class | |
| $nextNavItem =$activeNavItem.next('li'); | |
| if($nextNavItem.length){ | |
| //Set the link url to match that of the next nav item. | |
| $nextSectionLink.attr('href', $nextNavItem.find('a').attr('href')); |
This file contains hidden or 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
| /* A small tool for splitting MPO files into their JPG components. | |
| * $Id: mposplit.c,v 1.3 2011/07/07 00:11:38 chris Exp $ | |
| * Copyright (C) 2009-2011, Christian Steinruecken. All rights reserved. | |
| * | |
| * This code is released under the Revised BSD Licence. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | |
| * are met: | |
| * |
NewerOlder