Skip to content

Instantly share code, notes, and snippets.

@jaxbot
jaxbot / gist:5748513
Created June 10, 2013 12:58
Block nginx from serving .git directories
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@jaxbot
jaxbot / gist:6148496
Created August 4, 2013 00:11
My vimrc, pre-cleanup 8/3/13
" Must be the first line, apparently
set nocompatible
set encoding=utf-8
" Look
set background=dark
colorscheme twilight
set guifont=Source\ Code\ Pro
set number
set guioptions-=T " no toolbar
@jaxbot
jaxbot / fizzbuzz.vim
Created January 7, 2014 03:59
FizzBuzz in VimL
let c = 1
while c <= 100
if eval("c % 15") == 0
echo "FizzBuzz"
elseif eval("c % 3") == 0
echo "Fizz"
elseif eval("c % 5") == 0
echo "Buzz"
else
echo c
/*
* Medli.js
* Main entry point for the board system
*/
var cachedDOM = [];
// Because I'm lazy. And it does caching, so that's good, right?
var _g = function(id) { return cachedDOM[id] || (cachedDOM[id] = document.getElementById(id)); }
@jaxbot
jaxbot / glass.html
Created April 20, 2014 15:55
[wearscript] playing with accel and gyro
<html ng-app='glassApp'>
<head>
<script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0-beta.3/angular.js'></script>
<script>
glassApp = angular.module('glassApp', []);
glassApp.controller('glassController', function($scope) {
function server() {
WS.log('Welcome to WearScript');
WS.sound('SUCCESS')
@jaxbot
jaxbot / cardscrolladapter.java
Created June 16, 2014 22:39
CardScrollAdapter example on Google Glass
import android.app.Activity;
import android.view.View;
import android.view.WindowManager;
import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
import android.content.res.Resources;
import android.util.Log;
final int SCAN_QR = 4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, CaptureActivity.class);
startActivityForResult(intent, SCAN_QR);
}
// Testing Gists in Vim
// This is neat!
// Testing from work machine
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Article">
<head>
<meta charset='utf-8'>
<title>Awesome Post</title>
<meta property="og:title" itemprop="name" content="Awesome Post" />
<meta property="og:image" itemprop="image" content="http://example.com/awesomeimage.jpg" />
<meta property="og:description" itemprop="description" content="This post is awesome" />
</head>
@jaxbot
jaxbot / example.com
Last active August 29, 2015 14:04
Example.com on Brighthouse (RoadRunner)
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {