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 / Vim autocmds
Last active September 3, 2023 11:37
Vim MacBook LEDs
" 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/
<!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>
@jaxbot
jaxbot / form.html
Last active January 13, 2019 14:11
Node.js recaptcha example 2 (using AJAX instead of forms) https://jaxbot.me/articles/new-nocaptcha-recaptcha-with-node-js-express-12-9-2014
<!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,
@jaxbot
jaxbot / test.js
Created September 29, 2018 03:39
const puppeteer = require('puppeteer');
var sizes = [
{
name: "1080p",
width: 1920,
height: 1080,
isMobile: false
},
{
@jaxbot
jaxbot / MyArrayList.java
Last active January 8, 2017 15:58 — forked from wwsun/MyArrayList.java
A basic ArrayList implementation(Java)
public class MyArrayList {
private static final int DEFAULT_CAPACITY = 10;
private int theSize;
private int[] theItems;
public MyArrayList() {
clear();
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?",
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()
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

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