Skip to content

Instantly share code, notes, and snippets.

View davidhaley's full-sized avatar

David Haley davidhaley

View GitHub Profile
@davidhaley
davidhaley / mkv_to_mp4.sh
Created October 10, 2022 20:37
Convert all MKV files in the current directoy to MP4 (without re-encoding)
#!/bin/bash
for i in *.mkv; do
[ -f "$i" ] || break
OUTPUT="${i%.mkv}.mp4"
ffmpeg -i "$i" -c copy "$OUTPUT"
done
@davidhaley
davidhaley / config.rasi
Last active October 6, 2022 09:55
Rofi launcher config
# ~/.config/rofi/config.rasi
# repo: https://github.com/davatorium/rofi
# I found/modified this config from somewhere, but I forget where!
configuration {
display-drun: "Applications:";
display-window: "Windows:";
drun-display-format: "{name}";
font: "DM Mono Medium 10";
modi: "window,run,drun";
@davidhaley
davidhaley / gist:c4bc6a070c13523727fd10aae1c1e1c3
Last active October 9, 2022 03:14
LG C2 Enable 120hz (Nvidia) on login
# 1. Install nvidia-settings
$ pacman -Syu nvidia-settings
# 2. Run nvidia-settings
$ nvidia-settings
# 3. Set the correct refresh-rate in nvidia-settings (e.g. 120hz)
# X Server Display Configuration -> Set refresh-rate to desired, and Apply
# 4. Set the correct refresh-rate in Gnome
# Settings -> Display -> Set refresh-rate to match previous step
# 5. Verify Gnome's monitors settings are correct
$ code ~/.config/monitors.xml
# Common Settings
Home Button (Remote) -> Home Dashboard -> Gear Icon (Top Right) -> Edit Inputs -> Change input icon to PC (IMPORTANT for 4:4:4 Chroma - text clarity is atrocious without it)
General -> Always Ready -> Disabled
General -> AI Service -> Everything Disabled
General -> OLED Care -> Care Picture Settings -> Off
General -> OLED Care -> Device Self Care -> Energy Saving -> Energy Saving Step -> Off
General -> OLED Care -> Device Self Care -> Energy Saving -> Screen Off -> Off
General -> OLED Care -> OLED Panel Care -> Screen Move -> Off
General -> OLED Care -> OLED Panel Care -> Adjust Logo Brightness -> Off
General -> OLED Care -> OLED Panel Care -> Care Recommendations -> Off
@davidhaley
davidhaley / coin
Last active August 22, 2017 01:30 — forked from anonymous/coin
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Coin : MonoBehaviour
{
public GameObject coinPoof;
private static int coinsCollected = 0;
public int CoinsCollected
<!doctype html>
<html>
<head>Ajax Example</head>
<body>
<section>
<h1>Recent Posts</h1>
<article>
<h2>Post 1</h2>
<p>This is post1.</p>
</article>
"use strict";
$(document).ready(function() {
var form = document.forms[0];
var bet = document.getElementById("bet");
var guess = document.getElementById("guess");
var balance = 100;
var minBalance = 0;
@davidhaley
davidhaley / array-of-light.js
Created July 25, 2016 18:04
Array of Light
var array = [];
var arrayOfLight = function(x) {
for (i = 0; i < (x+1); i++) {
array.push(i);
}
console.log(array);
};
arrayOfLight(10);
require 'pry'
require_relative 'player'
# Two player math game.
class MathGame
RANDOM_MAX = 5
# Starts the program.
def initialize