Skip to content

Instantly share code, notes, and snippets.

View anhar's full-sized avatar

Andreas Hård anhar

View GitHub Profile

SourceTree & FileMerge not working

If you are experiencing issues on OSX where FileMerge doesn't open when you:

  • Right click on a file with conflicts
  • Select "Resolve Conflicts"
  • Select "Launch External Merge Tool"

Follow these steps to make sure you have everything setup correctly.

@anhar
anhar / learning_css.md
Created March 10, 2022 05:16
A basic tutorial on how CSS works

Learning CSS

So you figured out how HTML works, that's great! How do you level up from there? Well it would be nice to be able to add some styling to that page that only has a white background and a Times New Roman looking like font right?

CSS

There are two ways to add CSS styling to an HTML document.

Embed it right to on the HTML page

@anhar
anhar / CharactersService.swift
Created September 27, 2021 13:21
Improved error handling on top of tundsdev async/await example on YouTube: https://youtu.be/53lbqYYAPLw
//
// CharactersService.swift
// RickAndMortyApp
//
// Created by Andreas Hård on 2021-09-27.
//
import Foundation
struct CharactersService {
@anhar
anhar / stylus_dark_mode_styles.json
Created September 21, 2020 23:01
Using browser plugin stylus to override websites CSS styles to dark mode because too much white background color makes my eyes bleed.
This file has been truncated, but you can view the full file.
[
{
"enabled": true,
"updateUrl": "https://stylishthemes.github.io/GitHub-Dark/github-dark.user.css",
"md5Url": null,
"url": "https://github.com/StylishThemes/GitHub-Dark",
"originalMd5": null,
"installDate": 1588038024048,
"sourceCode": "/* ==UserStyle==\n@name GitHub Dark\n@namespace StylishThemes\n@version 4.0.70\n@homepageURL https://github.com/StylishThemes/GitHub-Dark\n@updateURL https://stylishthemes.github.io/GitHub-Dark/github-dark.user.css\n@license BSD-2-Clause\n@author StylishThemes\n@advanced color base-color \"Base color\" #4f8cc9\n@advanced color bg-color \"Background Color\" #202020\n@advanced dropdown bg-choice \"Background\" {\n crosshatch \"Cross-Hatch\" <<<EOT\n url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAAAAABURb1YAAAFoUlEQVR4AWXWCY7kMJcDYd9DiCD4jLr/EWezJOT8vbMXy8ZngpVPlLUWbWABJFVRZyqqdqIq9O9V1gJS14KFfYzASvgS1UTF1jSqE9qgNjYVoNxLfIhCBFKhOTdPNR11KpmKk4W2LhowESMPKHHBItCg2tqoGm0VbWnXAmxIAFALPIAtCxY4VVX7jqrSGRVlJnwqfRsAIG+BZ0EmHy7Jm3NMo6

GraphQL

GraphQL is a data query language developed internally by Facebook in 2012 before being publicly released in 2015. It provides an alternative to REST and ad-hoc webservice architectures. It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server. It is a strongly typed runtime which allows clients to dictate what data is needed. This avoids both the problems of over-fetching as well as under-fetching of data. GraphQL has been implemented in multiple languages, including JavaScript, Python, Ruby, Java, C#, Scala, Go, Elixir, Erlang, PHP, Python and Clojure.

Official websites:

@anhar
anhar / README.md
Last active September 6, 2015 16:11
Cleaning up a Windows 7/8/10 install as good as possible

README

  1. Download the ZIP folder

  2. Extract it to somewhere

  3. Place the "hosts" file in the following directory:

    C:\Windows\System32\drivers\etc\

  4. Run the "windows_privacy_fixes.bat"