Skip to content

Instantly share code, notes, and snippets.

@Dulani
Dulani / strip-autocomplete.user.js
Created August 7, 2018 15:54 — forked from david0/strip-autocomplete.user.js
Greasymonkey/Tampermonkey script that strips "autocomplete" attributes from username and password fields
// ==UserScript==
// @name Strip autocomplete attributes
// @namespace david0
// @version 0.1
// @description This plugin gives the control about your passwords back to your browser and allows the browser to store every password.
// @include http://*
// @include https://*
// @copyright 2014, David
// ==/UserScript==
@Dulani
Dulani / gitlab-ci.yaml
Created August 8, 2018 00:22
Gitlab CI and deployment
image: php:5.6
stages:
- test
- build
- deploy
test:
stage: test
script: echo "Running tests"
@Dulani
Dulani / minecraft_commands.txt
Created September 30, 2018 02:26 — forked from Dinnerbone/minecraft_commands.txt
Minecraft Java Edition 1.13 changes
advancement grant <targets> everything
advancement grant <targets> from <advancement>
advancement grant <targets> only <advancement>
advancement grant <targets> only <advancement> <criterion>
advancement grant <targets> through <advancement>
advancement grant <targets> until <advancement>
advancement revoke <targets> everything
advancement revoke <targets> from <advancement>
advancement revoke <targets> only <advancement>
advancement revoke <targets> only <advancement> <criterion>
#!/bin/bash
# --- Version history ---
# mrn: sleep for $freq instead of 3 seconds (forked)
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
@Dulani
Dulani / pushpop.R
Created April 4, 2019 13:34 — forked from leeper/pushpop.R
One-line push and pop in R
# push
push <- function(x, values) (assign(as.character(substitute(x)), c(x, values), parent.frame()))
# pop
pop <- function(x) (assign(as.character(substitute(x)), x[-length(x)], parent.frame()))
# example
z <- 1:3
push(z, 4)
z
@Dulani
Dulani / idletime.sh
Created April 18, 2019 14:33 — forked from Neil-Smithline/idletime.sh
Mac OS X Idle Time Shell Script
#!/bin/sh
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'
@Dulani
Dulani / miniconda_on_rpi.md
Created September 15, 2019 00:43 — forked from simoncos/miniconda_on_rpi.md
Install Miniconda 3 on Raspberry Pi
yum install httpd yum-utils createrepo
@Dulani
Dulani / README.md
Created October 17, 2019 23:47 — forked from timelyportfolio/README.md
Using arbitrary Leaflet plugins with Leaflet for R

Using arbitrary Leaflet JS plugins with Leaflet for R

The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.

If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.

import sys
debug = True
def exceptionHandler(exception_type, exception, traceback, debug_hook=sys.excepthook):
'''Print user friendly error messages normally, full traceback if DEBUG on.
Adapted from http://stackoverflow.com/questions/27674602/hide-traceback-unless-a-debug-flag-is-set
'''
if debug:
print('\n*** Error:')
# raise