Skip to content

Instantly share code, notes, and snippets.

View tkambler's full-sized avatar
:octocat:

Tim Ambler tkambler

:octocat:
View GitHub Profile
@tkambler
tkambler / linkedin-bulk-select.js
Created April 4, 2022 14:38
Script for bulk-selecting multiple messages on LinkedIn (for deletion)
/**
* Open the floating messages panel in the bottom right-hand corner of the LinkedIn screen. Click
* the three dots and select "Manage messages." Scroll down the page a few times so as to load several
* screens of messages (but not too many). The paste the following script into the developer console
* and press enter.
*
* All of the messages on your screen should now be selected. You can choose the "Delete" option to delete
* all of them in bulk.
*/
(() => {
#!groovy
try {
node('mac') {
ansiColor('xterm') {
stage 'Clean workspace'
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:432)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:429)
@tkambler
tkambler / gist:e6f0744c4e367b944720
Last active July 2, 2016 01:10
Yeoman - Run Loop
var generators = require('yeoman-generator');
module.exports = generators.Base.extend({
'writing': function() {
// ... 2/4
},
'prompting': function() {
// ... 1/4

Keybase proof

I hereby claim:

  • I am tkambler on github.
  • I am tkambler (https://keybase.io/tkambler) on keybase.
  • I have a public key whose fingerprint is C737 F71F F9E3 7A47 302C 1CE8 79ED 87E7 EF59 A998

To claim this, I am signing this object:

@tkambler
tkambler / gist:5222d276f783def5ece8
Last active April 1, 2019 18:02
Displaying Tabular Data in Today Scripts for Yosemite Notification Center
#!/usr/local/bin/node
var Table = require('cli-table');
var table = new Table({
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
, 'right': '' , 'right-mid': '' , 'middle': ' ' },
style: { 'padding-left': 0, 'padding-right': 0 }
@tkambler
tkambler / gist:71050d80f1a57ea83c18
Last active August 2, 2024 09:53
Calculate size of used LocalStorage space
/**
* Returns the total amount of disk space used (in MB) by localStorage for the current domain.
*/
var getLocalStorageSize = function() {
var total = 0;
for (var x in localStorage) {
// Value is multiplied by 2 due to data being stored in `utf-16` format, which requires twice the space.
var amount = (localStorage[x].length * 2) / 1024 / 1024;
total += amount;
}
@tkambler
tkambler / gist:fc2e44df387286c4ac07
Created July 2, 2014 17:36
Tracking file changes within Vagrant for real-time Browserify compilation
var async = require('async'),
glob = require('glob'),
browserify = require('browserify'),
_ = require('underscore'),
fs = require('fs'),
scriptBytes = 0,
compiled;
var getTotalBytes = function(patterns, cb) {
var tasks = [],
@tkambler
tkambler / hubot_plugin.js
Last active October 7, 2015 10:49
A simple script that demonstrates how you can create a Hubot plugin with raw JavaScript (i.e. without CoffeeScript)
var util = require('util');
/**
* A simple script that demonstrates how you can create a Hubot plugin with raw
* JavaScript (i.e. without CoffeeScript)
*/
var Plugin = function(robot) {
/**
* Instruct Hubot to respond when a message is directed at him, like so:
@tkambler
tkambler / gist:8569187
Created January 22, 2014 22:59
Given an element with a CSS value for 'max-height', this plugin will allow you to wrap any text that overflows the bounds of the element with a specified class name.
/**
* Given an element with a CSS value for 'max-height', this plugin will allow you
* to wrap any text that overflows the bounds of the element with a specified class
* name.
*
* Example:
*
* $(".container").trevanify('wrapping_class');
*/
$.fn.trevanify = function(overflow_class) {