Skip to content

Instantly share code, notes, and snippets.

@jaxbot
jaxbot / gist:5748513
Created Jun 10, 2013
Block nginx from serving .git directories
View gist:5748513
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@jaxbot
jaxbot / Vim autocmds
Last active Jan 28, 2019
Vim MacBook LEDs
View Vim autocmds
" Assuming keyboard_leds is built and available in your PATH,
" this will make capslock indicate whether or not you are in insert mode.
autocmd InsertEnter * :!keyboard_leds -c1
autocmd InsertLeave * :!keyboard_leds -c0
" To make Vim control the keyboard backlight, use this.
" Note that it's glitchy and you'll probably toss the idea soon after.
" I can see programmatically controlling the lights to be useful in other cases, though.
" Install Lab tick and set a hotkey for Toggle, and one for Brighten.
" http://labtick.proculo.de/
View form.html
<!doctype html>
<html>
<head>
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<h1>Register for test site</h1>
<form action="register" method="post">
<input type="text" name="username" placeholder="Username"><br>
View form.html
<!doctype html>
<html>
<head>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script>
function registerAPI(form) {
var params = {
username: form.username.value,
password: form.password.value,
email: form.email.value,
View test.js
const puppeteer = require('puppeteer');
var sizes = [
{
name: "1080p",
width: 1920,
height: 1080,
isMobile: false
},
{
@jaxbot
jaxbot / MyArrayList.java
Last active Jan 8, 2017 — forked from wwsun/MyArrayList.java
A basic ArrayList implementation(Java)
View MyArrayList.java
public class MyArrayList {
private static final int DEFAULT_CAPACITY = 10;
private int theSize;
private int[] theItems;
public MyArrayList() {
clear();
View survey.js
var SURVEY = [
{
question: "Write a few sentences about yourself.",
type: "paragraph",
table: "user",
key: "biography",
example: "Computer Science Major at UCF, clean, quiet, and love spending time with my cat.",
},
{
question: "Where are you looking for roommates?",
View run.py
from slackbot.bot import Bot
from slackbot.bot import respond_to
from slackbot.bot import listen_to
import random
import re
import sys
def main():
bot = Bot()
bot.run()
View best_by_time.txt
Mon 09:54 am,,10000
Mon 09:54 am,Garage Libra,86.891757696127
Mon 10:00 am,Garage Libra,86.891757696127
Mon 10:15 am,Garage Libra,88.480635551142
Mon 10:30 am,Garage Libra,93.64448857994
Mon 10:45 am,Garage Libra,97.616683217478
Mon 11:00 am,Garage Libra,95.729890764647
Mon 11:15 am,Garage Libra,96.524329692155
Mon 11:30 am,Garage Libra,94.93545183714
Mon 11:45 am,Garage Libra,91.658391261172
View readme.md

Python, pip, virtualenv on Windows

  1. Download Python -- please use this version!

THIS IS IMPORTANT Choose "Python 3.4.4 - Download Windows x86-64 MSI installer", specifically that one.

  1. Install it with default options
  2. After installing, open Control Panel -> System -> Advanced System Settings
  3. Click Environment Variables
  4. In the list on the bottom, choose Path and click Edit