NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
/* directive to disable input if num(chars) crosses maxLength in text-area in pagePopUp */ | |
angular.module('notify.pageEOCApp').directive('textMaxlengthDirective', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, ngModelCtrl) { | |
var maxlength = Number(attrs.textMaxlength); | |
function fromUser(text) { | |
if(text.length > maxlength) { |
/** scroll to top function in AngularJS */ | |
angular.module('demoApp').controller('controller', ['$scope', function($scope) { | |
$scope.scrollToTop = function($var) { | |
// 'html, body' denotes the html element, to go to any other custom element, use '#elementID' | |
$('html, body').animate({ | |
scrollTop: 0 | |
}, 'fast'); // 'fast' is for fast animation | |
}; | |
import os | |
import signal | |
from gi.repository import Gtk as gtk | |
from gi.repository import AppIndicator3 as appindicator | |
APPINDICATOR_ID = 'myappindicator' | |
def main(): | |
indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES) | |
indicator.set_status(appindicator.IndicatorStatus.ACTIVE) |
# Now available here: https://github.com/y0ast/pytorch-snippets/tree/main/minimal_cifar |
As often happens, I found the official documentation and forum answers to be "close, but no cigar", and so had to experiment a little to get things working.
The main problem for me was a lack of concrete configuration examples. That's not entirely GitHub's fault: having migrated from Google Domains to Namecheap in the middle of this project, I was once again reminded of how many different ways there are to do things in the name service universe [1].
Although you'd think the simplest setup would be to merely configure for the subdomain case (https://www.example.com), in my experience using the apex domain (https://example.com) instead resulted in fewer complications.
So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider: