Skip to content

Instantly share code, notes, and snippets.

// Download file from URL (redirect allowed).
function download(url, filename) {
return new Promise((fres, frej) => {
var req = http.get(url, (res) => {
var code = res.statusCode;
if (code>=300 && code<400) return download(res.headers.location, filename).then(fres);
if (code>=400) return frej(res.statusCode);
filename = filename || path.basename(url);
var file = fs.createWriteStream(filename);
res.pipe(file).on('close', () => fres(filename));
function toSnakeCase(x) {
if(x.search(/[a-z]/)<0) return x.replace(/[^A-Za-z0-9]/, '-').toLowerCase();
return x.replace(/[^A-Za-z0-9]|[^A-Za-z0-9]?([A-Z])/g, '-$1').toLowerCase();
}
const tempy = require('tempy');
const cp = require('child_process');
const path = require('path');
const fs = require('fs');
const os = require('os');
// Global variables.
const ORG = 'nodef';
const PACKAGE = 'extra-integer';
const STANDALONE = 'integer';
// # browserify
// # uglify
// 1. process .js -> single .js
// 2. process .js + package.json -> package.json
// 3. process .js + README.md -> README.md
// 4. create package and publish
const findNpmPrefix = require('find-npm-prefix');
const recast = require('recast');
const path = require('path');
const fs = require('fs');
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<script src="script.js"></script>
@wolfram77
wolfram77 / Bug #1865130 “[drm:uvd_v1_0_start [radeon]] *ERROR* UVD not resp...” : Bugs : linux-firmware package : Ubuntu.title
Last active May 4, 2020 11:10
[drm:uvd_v1_0_start [radeon]] *ERROR* UVD not responding, trying to reset the VCPU!!!
https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1865130
@wolfram77
wolfram77 / gpu-type.sh
Created March 18, 2021 14:52
Checking NVIDIA Tesla V100 machine details
#!/usr/bin/env bash
lspci | grep -i nvidia
# References
# - CUDA toolkit installation guide for Linux
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
@wolfram77
wolfram77 / learn-markdown.md
Last active June 25, 2025 20:25
Markdown is a lightweight markup language for creating formatted text using a plain-text editor.

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to the human users in its source form.

Awesome

@wolfram77
wolfram77 / small-vector.hxx
Created July 16, 2021 15:38
Trying this out, but too big, instead i will modify where i need it.
#pragma once
#include <array>
#include <vector>
using std::array;
using std::vector;
@wolfram77
wolfram77 / report-effect-of-stepwise-adjustment-of-damping-factor-upon-pagerank.md
Last active June 25, 2025 20:25
Effect of stepwise adjustment of Damping factor upon PageRank : REPORT

Effect of stepwise adjustment of Damping factor upon PageRank

While doing research work with [Prof. Kishore Kothapalli], and [Prof. Dip Sankar Banerjee].

Abstract — The effect of adjusting damping factor α, from a small initial value α0 to the final desired αf value, upon then iterations needed for PageRank computation is observed. Adjustment of the damping factor is done in one or more steps. Results show no improvement in performance over a fixed damping factor based PageRank. (🎞️ [slides])

Index terms — PageRank algorithm, Step-wise adjustment, Damping factor.