This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doReplace = function(doc) { | |
var treeWalker = document.createTreeWalker(doc, NodeFilter.SHOW_TEXT, null, null) | |
do { | |
var tmpnode = treeWalker.currentNode; | |
if (tmpnode.nodeValue) { | |
tmpnode.nodeValue = tmpnode.nodeValue.replace(/gamergate/ig, 'misogynist'); | |
tmpnode.nodeValue = tmpnode.nodeValue.replace(/trump/ig, 'misogynist'); | |
tmpnode.nodeValue = tmpnode.nodeValue.replace(/donald trump/ig, 'misogynist'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("ClientsideTextReplace 'doReplace' function", function() { | |
beforeEach(function() { | |
}); | |
var createTestDocument = function() { | |
return document.implementation.createHTMLDocument("test doc"); | |
} | |
describe("Is able to replace the core targets", function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Jasmine Spec Runner v2.5.2</title> | |
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.5.2/jasmine_favicon.png"> | |
<link rel="stylesheet" href="lib/jasmine-2.5.2/jasmine.css"> | |
<script src="lib/jasmine-2.5.2/jasmine.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MOTION_TMP=/tmp/motion | |
TARGET_EMAIL=$TARGET_EMAIL_HERE | |
which motion | |
if [ ! $? -eq 0 ] | |
then | |
echo "Cannot find motion service in PATH, is it installed?" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
screen -d -m sudo watch -n5 'bash /opt/bin/pop_motion_queue.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# October 2018. | |
# Written by Lisa Burton. | |
# Provided under the terms of the MIT license. | |
STACK_NAME='<<< YOUR_CLOUD_FORMATION_STACK_NAME >>>' | |
SAM_INPUT_TEMPLATE='<<< YOUR_SAM_FILE_HERE >>>' | |
SAM_OUTPUT_TEMPLATE='outputSamTemplate.yaml' | |
SAM_S3_BUCKET='<<< YOUR_S3_BUCKET_NAME >>>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const updateOccurenceTable = (byteOccurenceTable, inputBuffer) => { | |
inputBuffer.forEach(character => { | |
const byteOccurenceAccumulator = byteOccurenceTable[character]; | |
byteOccurenceTable[character] = byteOccurenceAccumulator !== undefined ? byteOccurenceAccumulator + 1 : 1; | |
}); | |
const { total } = byteOccurenceTable; | |
byteOccurenceTable.total = total ? total + inputBuffer.length : inputBuffer.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lda #$00 | |
sta $a0 | |
lda #$00 | |
sta $a1 | |
LSB_INC: | |
ldy $a0 ; Debug, shows the LSB in the Y register | |
inc $a0 | |
BNE LSB_INC | |
LSB_RESET: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Written for the CA65 assembler and tested on a NES emulator | |
.zeropage | |
counter_lsb: .res 1 | |
counter_msb: .res 1 | |
.proc RateLimit | |
lda #$EE ; Most Significant Byte 'interval' | |
sta counter_msb | |
LOOP_MSB: | |
lda #$00 ; Least Significant Byte 'interval' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.define OAM_TABLE_START $0200 | |
; .zeropage | |
; param_1: .res 1 | |
; param_2: .res 1 | |
; param_3: .res 1 | |
; temp_var_1: .res 1 | |
; temp_var_2: .res 1 | |
; temp_var_3: .res 1 |
OlderNewer