Skip to content

Instantly share code, notes, and snippets.

View bbeardsley's full-sized avatar

Brent Beardsley bbeardsley

View GitHub Profile
@MatheusMuriel
MatheusMuriel / modalBookmarklet.js
Created November 4, 2020 16:52
Bookmarklet code for open a modal
javascript:(function(){
let tailwind = document.createElement('link');
tailwind.href = 'https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css';
tailwind.rel = 'stylesheet';
document.body.appendChild(tailwind);
let style = document.createElement('style');
style.appendChild( document.createTextNode(`
.modal {
opacity: 0;
@aerobium
aerobium / ReplacingTtextInApachePOIXWPF.java
Created October 3, 2017 11:11
Replacing a text in Apache POI XWPF
iterateThroughParagraphs(doc, fieldsForReport);
iterateThroughFooters(doc, fieldsForReport);
iterateThroughTables(doc, fieldsForReport);
private void iterateThroughParagraphs(XWPFDocument doc, Map<String, String> fieldsForReport) throws NotFoundException {
for (XWPFParagraph paragraph : doc.getParagraphs()) {
iterateThroughRuns(paragraph, fieldsForReport);
}
}
@chriswbrad
chriswbrad / Wells Fargo - enable download
Created January 23, 2017 05:10
Enable easier and faster downloading of statements from Wells Fargo
Paste into console so statements will download when clicked instead of hijacking the current window.
File name will default to 'YYYY-MM-DD' instead of unreadable WF name.
This assumes statement titles are of the form "Statement MM/DD/YYYY (XXK, PDF)"
$('.page').unbind('click');
$("a[data-pdf='true']").each(function(i,el) {
title=$(el).text().trim().replace("Statement ", '');
// Default save as file name: (YYYY-MM-DD)
fileName = '20'+title.substr(6,2) + '-' + title.substr(0,2) + '-' + title.substr(3,2);
el.setAttribute('download',fileName + '.pdf');
@Luzifer
Luzifer / Dockerfile
Last active January 17, 2024 16:26
Ruby 1.8.7 Docker container based on Debian Jessie
FROM debian:jessie
ENV RUBY_VERSION 1.8.7-p374
ENV PATH /usr/local/rvm/gems/ruby-${RUBY_VERSION}/bin:/usr/local/rvm/gems/ruby-${RUBY_VERSION}@global/bin:/usr/local/rvm/rubies/ruby-${RUBY_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
RUN set -ex \
&& apt-get update && apt-get install -y curl \
&& gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
&& curl -sSL https://get.rvm.io | bash -s stable --ruby=${RUBY_VERSION}
@softe1988
softe1988 / commandLine.js
Last active January 25, 2017 17:39
Commandline Program to take user inputs and then return links using Horseman and Phantom
var chalk = require('chalk'),
CLI = require('clui'),
inquirer = require('inquirer'),
clear = require('clear'),
figlet = require('figlet');
clear();
console.log(
chalk.yellow(
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active April 5, 2025 06:45
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@andrewdc
andrewdc / gulpfile.js
Created April 14, 2014 15:39
Simple Static Site Generator with Gulp
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
rubysass = require('gulp-ruby-sass'),
fileinclude = require('gulp-file-include'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
livereload = require('gulp-livereload'),
lr = require('tiny-lr'),
connect = require('gulp-connect'),
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active March 12, 2025 18:03
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@nolanlawson
nolanlawson / completion-for-gradle.md
Last active September 25, 2024 12:51
Gradle tab completion for Bash. Works on both Mac and Linux.

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]
@stephanos
stephanos / build.gradle
Created January 27, 2014 09:48
Gradle: Automate IntelliJ IDEA project generation for a Java App Engine project
def jvmRunFlags = '''
-Xmx700m
- ...
'''.split().toList()
def jvmTestFlags = '''
-Dlocally=true
-ea
- ...
'''.split().toList()