Skip to content

Instantly share code, notes, and snippets.

View bateller's full-sized avatar
🎯
Focusing

Brian A. Teller bateller

🎯
Focusing
View GitHub Profile
@1forh
1forh / index.html
Last active May 4, 2016 14:52
Prevent map zoom on scroll
<div id="map-wrapper">
<iframe id="map-canvas"></iframe>
</div>
@lorin
lorin / png.js
Last active April 3, 2018 21:03
Convert svg to png with styling using phantomjs
#!/usr/bin/env phantomjs
/*
* Convert svg to png using PhantomJS
*
* Usage: png.js filename.svg filename.png
*
* Asses width and height attributes are present on the svg node
*
*/
var system = require('system');
@bateller
bateller / create_ami.sh
Created October 23, 2019 14:15
Create AMIs + Launch Configurations for non aws-cli experts for use in AutoScaling Groups
#!/bin/sh
#
# Copyright: 2017-2019 - B. Teller
# Created by: Brian Teller
# Description: Help non-shell or AWS experts create easy + quick AMIs for use within AutoScaling Groups
#
upSeconds="$(tail /proc/uptime | grep -o '^[0-9]\+')"
upMins=$((upSeconds / 60))
@lmj0011
lmj0011 / gitCheck.md
Last active May 1, 2020 08:05 — forked from mzabriskie/README.md
Check git status of multiple repos

Usage:

gitCheck [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.


Changes

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

Start weechat if you haven't already:

$ weechat

open up browser and go to: https://irc.gitter.im/ retrieve your /PASS

In weecaht run (thanks to raine):

@gimbo
gimbo / git-summary.sh
Last active August 11, 2021 18:30
git-summary.sh - summarise git repos in some folder
#!/bin/bash
# git-summary - summarise git repos at some path
#
# Adapted from https://gist.github.com/lmj0011/1a8dd1e376234ac7bf0fba2748ecdd0f
#
# Andy Gimblett, March 2017
usage() {
@alexwilson
alexwilson / cloudflare-challenge.js
Last active September 3, 2021 17:23
This is a project designed to get around sites using Cloudflare's "I'm under attack" mode. Using the PhantomJS headless browser, it queries a site given to it as the second parameter, waits six seconds and returns the cookies required to continue using this site. With this, it is possible to automate scrapers or spiders that would otherwise be t…
/**
* This is a project designed to get around sites using Cloudflare's "I'm under attack" mode.
* Using the PhantomJS headless browser, it queries a site given to it as the second parameter,
* waits six seconds and returns the cookies required to continue using this site. With this,
* it is possible to automate scrapers or spiders that would otherwise be thwarted by Cloudflare's
* anti-bot protection.
*
* To run this: phantomjs cloudflare-challenge.js http://www.example.org/
*
* Copyright © 2015 by Alex Wilson <antoligy@antoligy.com>
@hassy
hassy / lambda.js
Last active September 19, 2022 17:20
Different behavior of context.succeed() vs callback() in AWS Lambda
//
// Lambda's timeout needs to be >5 seconds, 10 should do
//
var startedAt = new Date();
var interval = setInterval(function () {
console.log(startedAt, new Date());
}, 1000);
@bricef
bricef / AES.c
Last active March 4, 2023 11:29
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>