Skip to content

Instantly share code, notes, and snippets.

View Nakroma's full-sized avatar

Nakroma

View GitHub Profile
console.log('TEST');
setInterval(async () => {
const response = await fetch('https://noahglynn.xyz/api/nowplaying/flow_radio_one');
const nowplaying = await response.json();
const songTitle = nowplaying?.now_playing?.song?.text;
document.querySelector('.audio-player .current-time').innerHTML = songTitle ? `Streaming ${songTitle}` : 'Streaming';
}, 10000)
@Nakroma
Nakroma / csv_multiprocessing.py
Last active April 9, 2023 10:42
Script for multiprocessing huge CSV/TSV files, originally made to process the MS-Celeb-1M dataset
#!/usr/bin/env python
import csv
import multiprocessing as mp
counter = None
def init(c):
global counter
@Nakroma
Nakroma / publish.cmd
Created May 6, 2017 16:11
publish script for python pypi package
rmdir "dist" /S /Q
rmdir "build" /S /Q
rmdir "blitz_js_query.egg-info" /S /Q
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*
@Nakroma
Nakroma / mongo_convert_price.js
Last active May 5, 2017 17:58
Converts string prices to ints
/**
* Converts price strings to price ints
* Run with 'mongo mongo_convert_price.js'
*/
var db = connect('localhost:27017/warframe-nexus');
var col = 'requests';
var count = db[col].count();
var current = 0;
'use strict'
const Method = require("../../../../Method.js")
/**
* Contains multi-purpose functions for child-methods and provides default values
*/
class Statistics extends Method {
constructor() {
super()
@Nakroma
Nakroma / mongo_data.js
Created April 21, 2017 18:41
Random request generation for nexus-stats
/**
* Generates different data test sets
* Run with 'mongo mongo_data.js'
*/
var db = connect('localhost:27017/nexus-stats');
var sets = [
//["ds_micro", 1000],
//["ds_tiny", 20000],
@Nakroma
Nakroma / tut.c
Created March 30, 2017 17:07
C List Pointer
#include <stdio.h>
#include <stdlib.h>
struct list_elem {
void* elem;
struct list_elem* next;
};
void add(struct list_elem* head, void* elem) {
while (head->next != NULL) {