Skip to content

Instantly share code, notes, and snippets.

View akashrajkn's full-sized avatar
🚀
Spaceship

akash raj akashrajkn

🚀
Spaceship
View GitHub Profile
@plembo
plembo / ghpwithnamecheap.md
Last active July 17, 2024 03:15
GitHub Pages with Namecheap custom domain

Using GitHub Pages with a custom domain: Namecheap Edition

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.

Procedure

So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider:

# Now available here: https://github.com/y0ast/pytorch-snippets/tree/main/minimal_cifar
@stockmind
stockmind / myappindicator_v4.py
Created September 5, 2017 17:05 — forked from candidtim/myappindicator_v4.py
Minimal Ubuntu AppIndicator in Python, with custom icon and a "Quit" menu item
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)
@akashrajkn
akashrajkn / scrollToTop.js
Created July 27, 2015 18:26
simple scroll to top function in AngularJS
/** 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
};
@akashrajkn
akashrajkn / textMaxlengthDirective.js
Created July 26, 2015 17:48
angularjs directive to limit the length of message in a textbox
/* 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) {
@Zearin
Zearin / python_decorator_guide.md
Last active July 12, 2024 11:37
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].