Skip to content

Instantly share code, notes, and snippets.

@nickdunn
nickdunn / delete.js
Created September 6, 2023 14:55 — forked from thameera/delete.js
Bulk delete Auth0 users
#!/usr/bin/env node
/*
* Install dependencies with:
* npm install request request-promise-native bottleneck
*
* Replace YOUR_TENANT_NAME, MGMT_TOKEN, and FILENAME
* The input file (FILENAME) should contain a list of user ids to delete, separated by newlines
*/
require 'bundler/setup'
require 'rake'
require 'dotenv/tasks'
require 'nokogiri'
require 'selenium-webdriver'
require 'spectre_client'
require 'open-uri'
WIDTHS = [1200, 768, 375]
BROWSER = :firefox
@nickdunn
nickdunn / SassMeister-input-HTML.html
Created February 14, 2014 17:11
Generated by SassMeister.com.
<div class="person">
<div class="person__body"></div>
<div class="person__image"></div>
</div>
<!DOCTYPE html>
<!--[if gt IE 9]><!--> <html class="gt-ie9 no-js" lang="en" prefix="og: http://ogp.me/ns#"> <!--<![endif]-->
<head><script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
<title>
Sweden: Saab restarts car production — HSBC Global Connections
</title>
@nickdunn
nickdunn / gist:5607392
Last active December 17, 2015 12:09
I run ElasticSearch on the same box as my Apache webserver (one single VPS). I authenticate every request to ElasticSearch.
1. Drop all incoming connections to ElasticSearch on port 9200:
iptables -A INPUT -j DROP -p tcp --destination-port 9200 -i eth0
2. Persist this change on reboot:
iptables-save > /root/my_iptables_config
/sbin/iptables-restore < /root/my_iptables_config
3. Create a directory in your web application, I usually name mine /_es and add an .htaccess file.
@nickdunn
nickdunn / robot.js
Created December 6, 2012 11:46 — forked from LasoR/robot.js
Shaking cannon
//FightCode can only understand your robot
//if its class is called Robot
var go=120;
var Robot = function(robot) {
};
@nickdunn
nickdunn / robot.js
Created December 6, 2012 11:46
BLAZE
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@nickdunn
nickdunn / gist:3655237
Created September 6, 2012 11:39
Very basic controller/action based on a page ID
// camelcase body ID e.g. #page-home => home, #page-contact-us => contactUs
var action = $('body').attr('id')
.replace(/^(page-)/, '')
.replace(/^([a-z]{1})/, function(letter) { return letter.toUpperCase(); })
.replace(/-([a-z]{1})/, function(letter) { return letter.replace(/-/,'').toUpperCase(); });
var Controller = {
// #page-home
home: function() {
...
<html>
<body>
<style>
* {
margin: 0;
font-family: Arial;
line-height: 1.6;
}
body {
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my_function="http://example.com">
<!--
Note the function declaration above.
While the namespace URI is from the function's extension, I've made up the prefix 'my_function' just for use in this doc.
-->