This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE policymap [ | |
<!ELEMENT policymap (policy)+> | |
<!ELEMENT policy (#PCDATA)> | |
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED> | |
<!ATTLIST policy name CDATA #IMPLIED> | |
<!ATTLIST policy rights CDATA #IMPLIED> | |
<!ATTLIST policy pattern CDATA #IMPLIED> | |
<!ATTLIST policy value CDATA #IMPLIED> | |
]> |
This file contains hidden or 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') | |
async function fileExists(path: string, flag: string): Promise<boolean> { | |
return new Promise<boolean>((resolve, reject) => { | |
fs.access(path, fs.F_OK, (err) => { | |
if(err) { | |
resolve(false); // no file exists | |
}else{ | |
resolve(true); | |
} | |
}); |
This file contains hidden or 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
FROM ubuntu:focal-20210921 | |
WORKDIR /app | |
# Ensures tzinfo doesn't ask for region info. | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && apt-get install -y \ | |
unzip curl \ | |
dumb-init \ |
This file contains hidden or 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
mysql> select "2eef3ed2-50a1-4566-9e7b-183fba8a60be" = 2; | |
+--------------------------------------------+ | |
| "2eef3ed2-50a1-4566-9e7b-183fba8a60be" = 2 | | |
+--------------------------------------------+ | |
| 1 | | |
+--------------------------------------------+ | |
1 row in set, 1 warning (0.00 sec) |
This file contains hidden or 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
server { | |
server_name wiki.setfive.com; | |
listen 443 ssl; | |
ssl_certificate /etc/httpd/ssl/setfive-ssl.chained.crt; | |
ssl_certificate_key /etc/httpd/ssl/setfive-ssl.key; | |
ssl_session_cache shared:le_nginx_SSL:1m; | |
ssl_session_timeout 1440m; |
This file contains hidden or 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
package com.setfive.demo.apiheaderdemo.filter; | |
import com.setfive.demo.apiheaderdemo.entity.ApiKey; | |
import com.setfive.demo.apiheaderdemo.repository.ApiKeyRepository; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.stereotype.Component; | |
import org.springframework.stereotype.Service; | |
import org.springframework.web.filter.GenericFilterBean; | |
import javax.servlet.FilterChain; |
This file contains hidden or 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
function followBot(params) { | |
return new Promise(async (resolve, reject) => { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
await page.goto('https://mobile.twitter.com/login'); | |
await page.waitFor('[name=\'session[username_or_email]\']'); | |
await page.$eval('[name=\'session[username_or_email]\']', (el, params) => el.value = params.username, params); |
This file contains hidden or 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
let k = ""; | |
for(let i = 0; i < 5; i++){ | |
setTimeout(() => { | |
console.log("k was " + k); | |
k = "hi".repeat(1 + i); | |
}, 1000 * i); | |
}; | |
setInterval(() => { |
This file contains hidden or 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
getWordCloudCounts(reviews: string[]): {} { | |
const words = {}; | |
const numReviews = reviews.length; | |
const wordCounts: IWordCount[] = []; | |
const stopWords = StopWords.get(); | |
for (let i = 0; i < numReviews; i++) { | |
reviews[i] = reviews[i].toString(); | |
const splitter = reviews[i].toLowerCase().split(' '); |
This file contains hidden or 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
export class Wordcloud { | |
public getWordCloudCounts(reviews: Review[]): IWordCount[] { | |
const wordsWithCounts: IWordCount[] = new Array(); | |
const numReviews = reviews.length; | |
wordsWithCounts.push({ | |
word: 'ThisIsAPlaceHolderThatWillBeRemoved', | |
count: 0, | |
}); |