This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A simple jQuery-based Table of Contents generator | |
* I needed a table of contents for some static markdown pages I created | |
* with bluecloth and rails (I'll make this a gem yet) and this is the result. | |
* | |
* This is one of my first afternoon forays into jQuery so it probably isn't | |
* the greatest code I've ever written. I have fully annotated the code with | |
* comments for others to learn and understand. Remove them before use. | |
* | |
* Requires jQuery | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Javascript | |
$("input").each(function () { | |
if (/[\u0600-\u06FF]/.test($(this).val())) { | |
$(this).addClass("right-to-left"); | |
} | |
}); | |
// CSS | |
.right-to-left { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPECIFICATION: | |
# | |
# check_sudoku() determines whether its argument is a valid Sudoku | |
# grid. It can handle grids that are completely filled in, and also | |
# grids that hold some empty cells where the player has not yet | |
# written numbers. | |
# | |
# First, your code must do some sanity checking to make sure that its | |
# argument: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Trailing whitespace is a pain when it comes to maintaining git repos because | |
# it makes changes look more numerous than they really are. Get rid of all those | |
# trailing spaces and tabs with this handy git hook. Copy this file to your .git/hooks | |
# directory and you can rest easy knowing you aren't flooding your repository with | |
# lines of trailing whitespace changes. | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Ryan's form</title> | |
<!-- Latest compiled and minified CSS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'clamp' | |
Clamp do | |
option ["--allbranches","-a"], :flag, "port all branches" | |
option ['-r', '--reponame'], 'reponame', 'Repository name, as a full https url' | |
option ['--forkname', '-f'], 'forkname', 'Repository name, as a full https url', default: 'dotcom' | |
option ['--shrink'], :flag, "Shrink the repo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Udacity Auto Advance | |
// @namespace https://omscs.gatech.edu/ | |
// @description Auto advance Udacity's classroom lecture videos | |
// @date 2017.01.25 | |
// @version 1.0.1 | |
// @match https://classroom.udacity.com/* | |
// @run-at document-end | |
// @run_at document_end | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install 7zip on aws linux | |
if grep --quiet 'PRETTY_NAME="Amazon Linux 2"' /etc/os-release | |
then | |
# For aws linux 2 | |
sudo amazon-linux-extras install -y epel | |
else | |
# for AWS linux 1 | |
sudo yum install -y epel-release | |
sudo yum-config-manager --enable epel |