Skip to content

Instantly share code, notes, and snippets.

View hising's full-sized avatar

Mattias Hising hising

View GitHub Profile
@hising
hising / .zshrc
Created November 23, 2023 19:38
.zshrc
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="nord-extended/nord"
HIST_STAMPS="yyyy-mm-dd"
source ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
zplug 'zsh-users/zsh-syntax-highlighting', defer:2
zplug 'zsh-users/zsh-history-substring-search', defer:3
@hising
hising / pods.sh
Created April 21, 2022 08:23
Reinstall pods
rm -rf ~/Library/Caches/CocoaPods Pods ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install
@hising
hising / game-loop.js
Created August 10, 2021 18:20
Simple Game Loop in JavaScript
let previousTime = 0.0;
let isGameRunning = true;
const update = (diff) => {
console.log(diff);
};
const render = () => { };
const loop = time => {
const dt = time - previousTime;
@hising
hising / keys.sh
Created July 30, 2021 16:05
Grab keys from Github
function get_public_keys () {
mkdir -m 700 -p ~/.ssh
for user in "$@"
do
curl -s https://github.com/"$user".keys >> ~/.ssh/authorized_keys
done
chmod 600 ~/.ssh/authorized_keys
}
@hising
hising / restart-nginx.sh
Created May 28, 2021 12:28
Restart nginx when fail starting after reboot
sudo fuser -k 80/tcp
sudo fuser -k 443/tcp
sudo service nginx restart
@hising
hising / gist:825407b6fcd614ffb110e92b12745293
Created March 19, 2021 01:28 — forked from iggym/gist:6023041
Apple iTunes Search API and RSS feeds. --- Apple very usefully provides unauthenticated json feeds for both the iTunes search and iTunes rss
Apple very usefully provides unauthenticated json feeds for both the iTunes search and iTunes rss
The Search API returns your search results in JavaScript Object Notation (JSON) format. JSON is built on two structures:
All JSON results are encoded as UTF-8. For more information on JSON, please see http://www.json.org.
---
Search API
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
---
RSS Info
import { useStaticRendering } from "mobx-react-lite";
import { action, observable } from "mobx";
import { useMemo } from "react";
useStaticRendering(typeof window === "undefined");
let companyStore;
interface CompanyServiceInterface {
loadCompany: (name: string) => {};
}
class CompanyServiceClient implements CompanyServiceInterface{
loadCompany(name: string): {} {
@hising
hising / schema-windows-terminal.json
Created June 28, 2020 09:33
Custom schema for Windows Terminal
{
"name": "Yetric",
"cursorColor": "#fafafa",
"selectionBackground": "#FFFFFF",
"background": "#263238",
"foreground": "#eceff1",
"black": "#0C0C0C",
@hising
hising / dom.html
Last active June 21, 2020 13:17
vanilla DOM elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script>
@hising
hising / json2table.html
Last active February 26, 2020 16:39
Fetch JSON and present it as a table
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JSON 2 Table</title>
<style>
body {