Skip to content

Instantly share code, notes, and snippets.

View Tsagadai's full-sized avatar

Christoph Curran Tsagadai

View GitHub Profile
#!/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
@Tsagadai
Tsagadai / udacity-auto-advance.user.js
Created April 1, 2017 03:32 — forked from bishtawi/udacity-auto-advance.user.js
Hacky way to auto advance Udacity's classroom lecture videos
// ==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
@Tsagadai
Tsagadai / migrate_git.rb
Last active June 8, 2016 06:39
A simple helper file for migrating between git accounts. It isn't perfect but it works.
#!/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"
<!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 -->
@Tsagadai
Tsagadai / remove-whitespace
Created November 23, 2012 03:58
A .git/hook for removing trailing whitespace from file before you commit
#!/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
@Tsagadai
Tsagadai / checker.py
Created September 11, 2012 05:55
My CS258 sudoku checker
# 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:
#
@Tsagadai
Tsagadai / gist:2223731
Created March 28, 2012 04:49
A simple Javascript/jQuery snippet to change textbox Arabic content to correctly display on the right. Punch this in after a pageload.
// Javascript
$("input").each(function () {
if (/[\u0600-\u06FF]/.test($(this).val())) {
$(this).addClass("right-to-left");
}
});
// CSS
.right-to-left {
@Tsagadai
Tsagadai / Markdown Table of Contents generator
Created March 14, 2012 02:30
A simple jQuery-based Table of Contents generator
/* 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
*/