Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Bobby Johnson NotMyself

🏠
Working from home
Block or report user

Report or block NotMyself

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo.js
function parseMessage(emotes, message) {
//build lookup object
const lookup = emotes.reduce((lookup, emote) => {
lookup[emote.name] = emote.imageUrl
}, {});
//swap words
const words = message.split(' ')
.forEach((word) => {
if(lookup[word])
View foo.cs
public class Startup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
View foo.js
function dice() {
}
function rps() {
}
const map = {
'!dice':dice,
'!rps':rps,
};
View foo.cs
public async bool isLive(int twitchId) {
return cache.GetOrAdd(twitchId, () => {
return await service.isLive(twitchId);
});
}
@NotMyself
NotMyself / launch.json
Created Feb 18, 2019
the tasks.json and launch.json from broxburn
View launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/api/bin/Debug/netcoreapp2.2/api.dll",
"args": [],
View Dockerfile
FROM microsoft/dotnet:2.2-sdk-alpine AS build
WORKDIR /app
COPY . .
RUN dotnet restore
RUN dotnet build
RUN dotnet publish -c Release -o /app/deploy
FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine AS runtime
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
View orig-sucker.js
const URLS = [
'https://swapi.co/api/planets/',
'https://swapi.co/api/people/',
'https://swapi.co/api/films/',
'https://swapi.co/api/starships/'
];
async function suckIt(urls) {
let p = []; //unneeded allocation
urls.forEach(u => {//switching to map here returns an array
View winner.js
const Twitter = require('twitter');
/**
* @param context {WebtaskContext}
*/
module.exports = function(context, cb) {
const client = new Twitter({
consumer_key: context.secrets.TWITTER_CONSUMER_KEY,
consumer_secret: context.secrets.TWITTER_CONSUMER_SECRET,
access_token: context.secrets.TWITTER_ACCESS_TOKEN_KEY,
View winner.js
const Twitter = require('twitter');
/**
* @param context {WebtaskContext}
*/
module.exports = function(context, cb) {
const client = new Twitter({
consumer_key: context.secrets.TWITTER_CONSUMER_KEY,
consumer_secret: context.secrets.TWITTER_CONSUMER_SECRET,
access_token: context.secrets.TWITTER_ACCESS_TOKEN_KEY,
View data2.json
{
"employees":[
{
"changedFields":[
"Department",
"Division",
"Job Title",
"Reports To",
"Effective Date"
],
You can’t perform that action at this time.