Skip to content

Instantly share code, notes, and snippets.

View dreamalligator's full-sized avatar
🐊

Tom dreamalligator

🐊
View GitHub Profile
@dreamalligator
dreamalligator / github.html
Last active December 18, 2015 01:19
A Gist to forkify any jekyll page with pure css. See http://antivapor.github.io/code/2013/06/03/fork-me/
{% if {{page.github}} == NULL %}
<div class='fork_this'><a href='https://github.com/antivapor'></a></div>
{% else %}
<div class='fork_this'><a href='{{page.github}}'></a></div>
{% endif %}
@dreamalligator
dreamalligator / sfsu.user.js
Created July 30, 2013 21:16
SFSU user script to re-log yourself back in.
// ==UserScript==
// @name SFSU
// @namespace namethisspace
// @description Personal user script for SFSU
// @include https://idp.sfsu.edu/idp/Authn/UserPassword
// @require http://code.jquery.com/jquery-latest.min.js
// @version 1
// ==/UserScript==
// This user script auto-logs you into SFSU. I suggest that you do not save your password OR username in this. Instead, make a quick script to save your username and password in Greasemonkey's persistent data. I made this because I was continually annoyed at how many times I have to log back in. Be safe with your information.
// Example of such a script:
@dreamalligator
dreamalligator / piratebay.user.js
Last active December 24, 2015 13:29
Sort TPB by seeds.
// ==UserScript==
// @name piratebay
// @match https://thepiratebay.se/*
// @match http://thepiratebay.se/*
// @run-at document-end
// @grant none
// @version 1
// ==/UserScript==
document.getElementsByName("orderby").item(0).setAttribute("value","7");
@dreamalligator
dreamalligator / algebraic.scad
Last active December 27, 2015 17:59
Beemo from Adventure Time
//Beemo by Antivapor
$fn=50;//number of fragments for arcs
//triangle button parameters
a=-5;//x
b=2;//z
c=-3.5;//y, use diffence of abs(a-c) for scaling
d=b+2;//z-thickness
p1=[a,b,c];
p2=[a,d,c];
p3=[a,d,a];
@dreamalligator
dreamalligator / image
Created January 14, 2014 04:24
image snippet for Jekyll
{% comment %}
update image path to your rel path
usage:
{% include image src="post.images[0]" %}
{% include image src="whatnot.jpg" %}
{% endcomment %}
{% assign imgpath="/images/" %}
{% if include.src %}
<img src="{{ imgpath }}{{include.src}}">
{% elsif post.images[0] != NULL %}
@dreamalligator
dreamalligator / planets.ipynb
Created April 4, 2014 06:25
To test the Pelican Liquid Tags plugin.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dreamalligator
dreamalligator / aot.ahk
Created April 25, 2014 18:43
A basic Autohotkey script to make windows always on top..
; Always on Top
; https://gist.github.com/digitalvapor
; press CTRL+Space to toggle a window to always on top.
; Winset: http://ahkscript.org/docs/commands/WinSet.htm
; WinSet, Attribute, Value [, WinTitle, WinText, ExcludeTitle, ExcludeText]
; If you are going to make another window on-top that was 'ran as admin', then you'll want to run your autohotkey script as admin too.
^SPACE:: Winset, AlwaysOnTop, Toggle, A
@dreamalligator
dreamalligator / post-receive
Created April 28, 2014 19:54
My current Git hooks.
#!/bin/sh
WEB_DIR=~/digitalvapor
# remove any untracked files and directories
git --work-tree=${WEB_DIR} clean -fd
# force checkout of the latest deploy
git --work-tree=${WEB_DIR} checkout --force
# if need to exclude some files from being cleaned
@dreamalligator
dreamalligator / server.js
Last active August 29, 2015 14:00
My server file. `node server.js`
//change mywebdir to the folder you wish to serve
var port = 80
var mywebdir = 'myoutput'
var connect = require('connect')
connect().use(connect.static(mywebdir)).listen(port);
console.log('Server running on port '+port);
/*
* Dan Kirshner - dan_kirshner@yahoo.com
*
* You are welcome to make free use of this software. Retention of my
* authorship credit would be appreciated.
*
* Version 1.3. 2013-12-01 Correct loop over turns -- don't have early cut-off
* Version 1.2. 2012-09-09 Use discrete polyhedra rather than linear_extrude()
* Version 1.1. 2012-09-07 Corrected to right-hand threads!
*/