Skip to content

Instantly share code, notes, and snippets.

View bobbbay's full-sized avatar
🐤
Learning to fly

Bob bobbbay

🐤
Learning to fly
View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@Aatch
Aatch / borrow-example.rs
Last active July 5, 2023 04:22 — forked from kolmodin/rust-json.rs
An example and explanation of how to use lifetimes and borrowing to avoid copying, while maintaining safety.
extern mod extra;
use extra::json::*;
/*
* This function manages to do absolutely no copying, which is pretty cool.
*
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They
* indicate how long something lasts (before it's freed). They can't change how
* long something lives for, they only allow you to tell the compiler stuff it
@gilbertw1
gilbertw1 / .Xresources
Last active December 2, 2022 10:51
XMonad Configuration
Xft.dpi: 120
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintslight
rofi.color-enabled: true
rofi.color-window: #282828, #282828, #268bd2
rofi.color-normal: #282828, #ffffff, #282828, #268bd2, #ffffff
rofi.color-active: #282828, #268bd2, #282828, #268bd2, #205171
anonymous
anonymous / to-ascii.rs
Created June 8, 2016 17:19
/* convert from i32 to value represeting ascii codes - take notes, mozilla! */
fn to_ascii(i: &i32) -> String {
let a = match *i {
0 => "NUL",
1 => "SOH",
2 => "STX",
3 => "ETX",
4 => "EOT",
5 => "ENQ",
6 => "ACK",
@m1dnight
m1dnight / Lexer.x
Created June 30, 2016 02:32
Monadic Parser and Lexer using Alex and Happy
{
module Lexer where
}
%wrapper "monadUserState"
$digit = 0-9 -- digits
$alpha = [a-zA-Z] -- alphabetic characters
-- Each token has a function on the RHS that is a function (String ->
#include <stdio.h>
#include "bgfx/bgfx.h"
#include "bgfx/platform.h"
#include "bx/math.h"
#include "GLFW/glfw3.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3native.h"
#define WNDW_WIDTH 1600
#define WNDW_HEIGHT 900
@AjkayAlan
AjkayAlan / WSLWindows10Setup.md
Last active April 29, 2024 15:43
Windows SubSystem For Linux setup that I like with some developers stuff mixed in

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update
#!/bin/bash
# MIT License
#
# Copyright (c) 2019, Necdet Efe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@misuzu
misuzu / oracle-cloud-nixos-install.md
Last active November 9, 2024 22:22
Install NixOS on Oracle Cloud over Ubuntu 18.04

Install NixOS on Oracle Cloud over Ubuntu 18.04 (make sure to use Ubuntu 18.04 or this may not work)

# install useful tools
sudo apt-get update
sudo apt-get install --no-install-recommends -y nano mc git

# prepare /boot
sudo umount /boot/efi
sudo mv /boot /boot.bak
@zicklag
zicklag / Cargo.toml
Created February 1, 2020 19:28
Example of using rust-peg parser and chic error messages
[package]
name = "parserator"
version = "0.1.0"
authors = ["Zicklag"]
edition = "2018"
[dependencies]
peg = "0.6.1"
anyhow = "1.0.26"
chic = "1.2.2"