Skip to content

Instantly share code, notes, and snippets.

View HusseinElMotayam's full-sized avatar

Hussein El Motayam HusseinElMotayam

View GitHub Profile
@HusseinElMotayam
HusseinElMotayam / random-wallpaper.sh
Last active January 26, 2024 19:50
Bash script to fetch random wallpapers from Unsplash and set it on Ubuntu.
#!/bin/bash
wget -O /tmp/wallpaper.jpg https://source.unsplash.com/3840x2160/?wallpapers
gsettings set org.gnome.desktop.background picture-uri file:///tmp/wallpaper.jpg
gsettings set org.gnome.desktop.screensaver picture-uri file:///tmp/wallpaper.jpg
# Don't forget to make it executable via: chmod +x random-wallpaper.sh
# To schedule every 10 minutes:
# Run: crontab -e
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
# This snippet shows how TokenAuthenticatable works in Devise today.
# In case you want to maintain backwards compatibility, you can ditch
# devise's token mechanism in favor of this hand-rolled one. If not,
# it is recommended to migrate to the mechanism defined in the following
# snippet (2_safe_token_authenticatable.rb).
#
# In both snippets, we are assuming the User is the Devise model.
class User < ActiveRecord::Base
# You likely have this before callback set up for the token.
before_save :ensure_authentication_token