How to use IR Emitters on Linux
I wanted to use Face unlock on Linux and receive all the same features as Windows Hello. Using howdy and this guide, you can!
Resolve Howdy exception when adding your face
I wanted to setup face unlock on Linux with my new Dell XPS 13. This is how you can set it up for yourself!
How to reset the Windows password of a locked computer
I recently found myself locked out of my old school laptop. I did not have the windows password or the ability to login to any account on the machine.
How to fix ReferenceError: globalThis is not defined
"ReferenceError: globalThis is not defined" is an error produced by some newer JavaScript libraries as they access globalThis.
How to fix refreshing on a new tab extension for Google Chrome
By default if you try to refresh custom new tab in a Google Chrome extension, you are met with a file not found error.
The story of my first Chrome Extension and its tragic demise
I had the idea in my mind that I wanted to create and have my own chrome extension for a few years now.
Lazy load services using Socket Activation
Lazy loading services allows services to only be started once they are needed.
How to make a div fit the size of its children
You can make a div fit the size of its children by using `display: inline-block`
How to pause a script in Bash
In order to make a script in Bash pause, sleep or wait for a period of time you need to use the command `sleep`
Start a new Flutter project and Connect it to Firebase
It can be tricky to get a new Flutter project to connect to Firebase and work. Version mismatches can be a real killer!
Use promises in Google Apps Scripts
To use the latest es6 Promises in google app scripts it is very trivial to do so.
List all installed apt packages in Linux
To list all the installed apt in linux you can use `apt list --installed`.
Get the last element of an array in TypeScript
There are a few ways you can get the last element of an array in typescript
My personal rules of programming
These are some rules I try and stick to while programming. I suggest you have a think about adopting these as I feel they are great values to code by.
How to request different scopes on a Google Apps Script
To request scopes in a Google Apps Script you need to add them to the appscript.json file.
Keep phone unlocked while USB Debugging
It is a real time saver to keep your phone unlocked while developing an app. 'Stay awake mode' allows you to keep your phone unlocked.
Run the application you are developing on your device
There are a few steps and potential gotchas in setting up application debugging on your local device.
How to make xscreensaver stop from promiting for user input
Sometimes xscreensaver will prompt the user to enter their password thinking they are trying to unlock the computer.
IF/ELSE syntax in LUA
If/ If Else is an integral function in any program or script. This is the syntax for such statement in LUA.
How to show the git branch in Fish
Show the git branch on the end of the terminal prompt is a really useful modification as you can always see the branch you are on!
How to find the current git user
To find the current git user you can use the following git command
Install fish terminal and set as the default terminal
Fish terminal is a great terminal. I was initially heisitant to try it but cnce I gave it a go I really liked it.
Get additional lines before and after grep match
To get additional lines before and after the grep match you can add the arg **-n**
How to iterate over a map in Typescript
You can iterate over a map using the `forEach` method.
SQL INSERT, UPDATE, DELETE like a pro with RETURNING
You would recognise the following as a pretty typical `SQL` insert query with an extra line unlocking a powerful feature.
Efficiently: The Chrome extension to save your time!
Do you ever find yourself unconsciously opening webites out of habbit?
Disable Hibernation on Windows to speed up your pc
Having Windows hibernation on is a big killer due to the `Hiberfil.sys` file.
Clear up unused space in docker
Every time you run `docker compile` on a Dockerfile a container is created, taking up space on your computer.
Enable the caching of Images in Google Cloud Storage Buckets
To enable the caching of images in Google Cloud Storage buckets you need to set the file or bucket to public and set the `Cache-Control` attribute.
Fix the routing while using Firebase hosting
To fix the routing you need to include the rewrites section in `firebase.json`
Get IP Address in Linux
To get the IP Address in linux you can use `ifconfig` or `hostname -I`
Connect Bitbucket Pipelines with Google Source Repositories
To allow Bitbucket Pipelines access to your personal Google Source Repositories you need to do a few steps.
Calculate the remaining scroll distance in Angular
To Calculate the remaining scrollbar distance in Angular you need to perform some simple calculations on various window and document variables.
How query the Firebase Firestore in Angular
To query the firebase firestore in angular you can do the following
Get the Debug Certificate SHA1
How to get the debug certificate SHA1
AngularJS component lifecycle cheatsheet
These are the lifecycles to remember in AngularJS.
How to use ng-repeat in AngularJS
Here is a quick example of ng-repeat usage and implementation
Using ng-switch in AngularJS
ngSwitch is the equivalent of a `switch` in java or other modern languages
How to make an element autoexpand right to left in HTML
Making an element expand the opposite direction is a useful html trick to remember
Create an Observable using RxJS
Creating an Observable in different ways is sometimes required based on the situation at hand. This is all you need to know!
How to alias a command in git
Aliasing a command is very useful as it lets you shortcut a normal workflow and work more efficiently!
How to add environment path to Fish terminal
This is how you add an environment path to Fish terminal
How to add keybindings in fish
Keybindings are really useful and save time.. this is how you utilize them in Fish terminal!
How to make tab autocomplete in fish terminal
Making tab autocomplete in Fish terminal is a great customisation I strongly recommend as it allows you to press tab to complete the command.
How to try Fish terminal temporarily
Trying fish without the burden of changing your current terminal is useful incase you do not like Fish terminal
Create a Bootable usb on Linux
**WoeUSB** is the easiest and has the best compatibility for for all ISO's including Windows
The difference between services and providers in AngularJS
An easy way to remember it is that **Providers** are at config time (before the application has finished loading).
Create a delay or sleep in JavaScript/TypeScript
To create a delay or sleep you use setTimeout. setTimeout is an essential function for every developer to memorise!
Why and How you should use a Sinon Spy
Sinon spys and stubs are very using in testing code. Spys and Stubs allow you to verify if a function was called and how it was called (args).
How to use Component/Directive's in AngularJS
Here is a easy way to create a component or directive in AngularJS. This is an AngularJS Essential!
Change the DNS in Linux
Changing the DNS in linux is pretty useful to get past any censorship your isp has imposed on you. *For example thepiratebay.org, 4chan.org*
Essential hotkeys for Google Chrome
Hotkeys in Google Chrome make your life way easier! All the power users of Google Chrome are using these hotkeys!
Setting the src for html elements
Setting the **src** attribute for elements is different if you need to reference a AngularJS variable.
Filtering an array with a function that returns a Promise
You cannot filter an array using `Array.prototype.filter` using a promise as the function is synchronous and therefore does not support promises.
Install kdeconnect on linux
KDEConnect is a very useful application which allows you to control your computer and send commands from your smartphone!
How to copy files in linux using CP
You can copy files in linux using CP
Ensure fonts render nicely in Google Chrome on Linux
Be default linux does not tell fonts to render with antialiasing and other nice features.
How to add numbers in bash
To add a number you need to encase the expression in `$((` `))`
All Form Options for Angular Schema Form
Here is a cheatsheet for every option for a form value in Angular Schema Form
How to nest commands in bash
To use nested commands in bash you can surround the child command with backticks **\`** or **`${}`**
How to create an empty list in Java
Lists in Java are pretty powerful and this is how you create them
How to find a files age in git
You can find a files age using the git log command. As seen below
How to find a files latest changed time in git
You can find a files latest changed time using the following
Check if a file exists in Java
To check if the file is is a file in Java you need to do the following
Compare arrays with Java
There are many such use cases where you will find yourself required to compare two arrays in Java.
Convert list to array in Java
This is how you convert a list to an array in Java
Convert bytes into a String in python
I recently needed to convert a bytes object into a readable string format. I found that I could do so very easily using the following method.
All the ways to create a List in Java
The various ways you can create a list in Java
How to create a symlink in linux
Symlinks are very useful as they allow you to make one file point to another file
How to decode a string in java
To decode a string in Java you can import java.net.URLDecoder.decode
Ensure relative paths work in a bash script
To ensure relative paths work in a bash script you can set the working directory to the directory the script is in.
Adding a default value constraint to a column in SQL
To add a default value to a column in SQL you can do the following
Alter a table droping a columns default value
To drop a default value from a column you need to alter the column and `DROP DEFAULT`
Add/Remove/Modify a column on a table in SQL
Sometimes you need to alter a table without dropping it. A big use case for this is a migration script adding or removing a column on a table.
Check a column does not equal another column in SQL
To check that a column does not equal another column in SQL you can do the following
Convert an array to a object in TypeScript
To convert an array to a object in typescript you can use the following helper function
How to copy files over ssh
You can copy files over ssh using the command scp.
All about functions in LUA
Functions are the core of any good program or script. Functions in LUA are in the following format
How to create a SSH key
SSH keys are useful as they allow you to securely identify yourself. You can create a SSH key by doing the following
How to create a view in SQL
You can create a view in SQL by following the following syntax.
How to drop a function in SQL
Dropping or deleting a function in SQL is useful for many different scenarios. You might need to drop and re-create or you might not need the function anymore
Drop a trigger from a table
To drop a trigger from a table you need this command
Load a properties file in Java
This is how you load a properties file in Java
How to merge a branch in git with an unrelated history
You can merge a branch with a different history by adding the flag `--allow-unrelated-histories`
Proxy requests using Webpack
Using webpack you can proxy requests from one directory eg `http://localhost:8080/profile` to another address.
How to put phantomjs on $PATH
Putting phantomjs on the path will stop it downloading every time and therefore decrease the amount of time requiried to npm install.
How to remove a file from a Git Repo
To remove a file from a git repository you need to remove the cached version of it.
How to allow insecure hosts in Docker
To allow docker to connect to a insecure host (a host using http instead of https) you need to edit the daemon.json to have some config!
Scroll to the the top of the page automatically in AngularJS
You can scroll to the top of the page automatically by injecting Window and using the function scroll(x,y).
Installing Google Drive on Linux
Google Drive is really useful *I use it for the central location of this blog infact!*
Installing or uninstalling a package with pip
To install or remove/uninstall a python package you use pip.
How to install AwesomeWM on xubuntu
Installation guide for AwesomeWM on xubuntu.
How to list active processes in linux
You can list the active processes in linux using `ps`
How to load more days on the Agenda view in GCalCLI
By default gcalcli loads 7 days on the agenda view. You can specify how many you want if you give it 2 number args, for example:
Incrementation in LUA
There is no such thing as *Advanced Operators* **`++`** or **`--`** in Lua
How to read from a properites file using Bash
Reading from a properties file is a set some config outside of the script for ease of editing.
How to refresh the build image using docker-compose
To refresh the build image, you need to add `--build` to the docker-compose command.
Remove the New Login button from xscreensaver
To remove the xscreensaver `New Login` button you need to set the entry for `XScreenSaver.newLoginCommand` to an empty value.
Using services in linux with Systemctl
Services in Linux are generally things that run in the background providing a useful function or 'service'. Systemctl is the 'service manager'.
Setting properties in a properites file using bash
To set or update properties in a properties file from a bash script you can use **sed**
Set the default value via Form - Angular Schema Form
Currently it is not possible to declare a default value via the form object.
What is TAIL in Linux and how you should use it!
You might wonder 'how do I get the last lines of a log file' or 'how do I get new lines written to a file in linux'. Well tail is what you need!
The power of Stream.of() in Java
Stream.of() can be used instead of creating an array then iterating over it.
Using OAuth with Google APIs
This is a guide to using OAuth with Google APIs. This document shows how to get a Refresh Token which you can use inside your application.
Using OR statements in Gmail filters
Creating filters in Gmail is a great way to help manage and achieve a tidy inbox.
Why its important to use private 0arg constructor for Java
When creating util classes in java you should ensure you add a 0arg private constructor