Skip to content

Instantly share code, notes, and snippets.

/*
* 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 / 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
@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
private String getHTTPString(String url, CookieStore jar) {
try {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
httpget.setHeader("User-Agent", UA);
httpclient.setCookieStore(jar);
HttpResponse response = httpclient.execute(httpget);
InputStream inputStream = response.getEntity().getContent();
@jaxbot
jaxbot / form.html
Last active October 4, 2015 17:59 — forked from divneet/index.js
<!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 / 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;
if (!window.Bastide) window.Bastide = {};
window.Bastide.Registration = {
signup: function() {
var nameInput = document.querySelector('#signUpModal .name'),
emailInput = document.querySelector('#signUpModal .email'),
schoolInput = document.querySelector('#signUpModal .school');
var params = {
name: nameInput.value,
email: emailInput.value,
@jaxbot
jaxbot / gist:54eaeac526c4e161e4c7
Last active August 29, 2015 14:18
PyCon WiFi auto-j'accepte

Here's how to automatically log in to the WiFi at PyCon. Dumping out a few different methods here, check back for updates!

Chrome

  1. Install Tampermonkey
  2. Add this script:
// ==UserScript==
// @name         Pycon auto j'accept
// @namespace http://your.homepage/
$("#thebutton").on("click", function(t) {
t.preventDefault(), t.stopPropagation();
if (e.hasClass("pressed"))
return;
r.thebutton._countdownInterval = window.clearInterval(r.thebutton._countdownInterval), r.thebutton._setTimer(6e4);
var n = {seconds: $("#thebutton-timer").val(),prev_seconds: r.thebutton._msgSecondsLeft,tick_time: r.thebutton._tickTime,tick_mac: r.thebutton._tickMac};
$.request("press_button", n, function(e) {
console.log(e)
}), e.addClass("pressed").removeClass("unlocked"), r.thebutton.pulse()
})