Skip to content

Instantly share code, notes, and snippets.

@allykzam
allykzam / firstpage.html
Created July 18, 2012 17:15
jQuery $("body").scrollTop() issue
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Frame page</title>
</head>
<frameset rows="100,*">
<frame name="top" src="otherpage.html">
<frame name="bottom" src="otherpage.html">
</frameset>
</html>
@allykzam
allykzam / 01_VanillaKernel
Created July 1, 2013 22:19
Two files that can be used to rebuild a vanilla kernel on Arch linux. 01_VanillaKernel needs to be chmod 777 and located at /etc/grub.d/01_VanillaKernel, kernelbuildscript needs to be chmod +x anywhere you can point to it, and then just call it from the root directory of the kernel's source code. Code assumes your boot partition is /dev/sda1, an…
#!/bin/sh
exec tail -n +3 $0
menuentry 'Vanilla Kernel' {
VanillaVersion="3.9.8"
RootPartition="12345678-9abc-def0-1234-56789abcdef0"
load_video
set gfxpayload=keep
insmod gzio
@allykzam
allykzam / endfibs.hs
Last active December 31, 2015 20:39
This code will find "the last 20 elements of the Fibonacci series backwards" Of course it will never actually work. Runs for about 5 seconds on my machine and then complains it's out of memory.
{-
- Fast doubling Fibonacci algorithm
- Copyright (c) 2011 Nayuki Minase
-
- http://nayuki.eigenstate.org/page/fast-fibonacci-algorithms
-}
-- fibonacci n = F(n)
fibonacci :: Integer -> Integer
@allykzam
allykzam / mod.css
Created January 16, 2014 15:41
CSS for the Chrome plugin Stylish to put a dark color back into the twitter menu bar
.global-nav-inner {
background-color: #2f2f2f;
}
module FParsec.Binary
open System
open System.Text
open System.Text.RegularExpressions
open FParsec
[<RequireQualifiedAccess>]
module File =
let readAllString path =
@allykzam
allykzam / INIParser.fs
Last active August 29, 2015 14:03
F# parser for INI files
(*
* Copyright 2014 Anthony Perez (@amazingant)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@allykzam
allykzam / 1_settings.diff
Created July 22, 2014 15:42
GitLab SSH URL change
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index f55e69c..b6f1ad9 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -10,11 +10,7 @@ class Settings < Settingslogic
private
def build_gitlab_shell_ssh_path_prefix
- if gitlab_shell.ssh_port != 22
- "ssh://#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:#{gitlab_shell.ssh_port}/"

Keybase proof

I hereby claim:

  • I am amazingant on github.
  • I am amazingant (https://keybase.io/amazingant) on keybase.
  • I have a public key whose fingerprint is EBAF 1D9C B975 15EC 4BA5 F334 7A60 14E3 165D 4E15

To claim this, I am signing this object:

@allykzam
allykzam / GitHub_Branch_Issues.sh
Last active August 29, 2015 14:08
Bash script that fetches issue descriptions from GitHub via curl and adds them into the branch listing from git.
#!/usr/bin/env bash
# To use this script, go into your GitHub account settings, go into the
# Applications section, and then under `Personal access tokens` click
# `Generate new token`. Name the token whatever you want, give it access
# to the `repo` and `public_repo` scopes (`user` and `gist` are also
# selected by default, but you don't need them for this).
#
# Take the generated token and store it in your personal .gitconfig
# (located at either ~/.gitconfig or ~/.config/git/config on OSX/*nix)
@allykzam
allykzam / Errors.fs
Last active September 14, 2020 17:27
F# code for getting attribute data off discriminated union cases
type FatalError(message: string) =
inherit System.Attribute()
member __.Message = message
type Errors =
| [<FatalError("The value specified is currently not available")>] UnknownValue
| NotAnError
let PrintErrorMessage : Errors -> string =
fun err ->