Discover gists
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
// download | |
let counter = 0; | |
let prefix = "TamilFreakers"; | |
const LAST_INDEX = 1210; // get the message Id of last message (right click on the latest post, "copy message link".. this should have latest message id") | |
let messages = Array(LAST_INDEX).fill(0).map((x, i) => `message${i + 1}`).reverse(); | |
let textContents = []; | |
let htmlContents = []; |
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
// snippet from google gemini | |
function convertImageURLToBase64(imageUrl) { | |
fetch(imageUrl) | |
.then(response => response.blob()) | |
.then(blob => { | |
const reader = new FileReader(); | |
reader.readAsDataURL(blob); | |
reader.onloadend = function() { | |
const base64data = reader.result; |
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
// open terminal -> "npm install winston -S" | |
const winston = require('winston'); | |
// snippet from https://stackoverflow.com/questions/51012150/winston-3-0-colorize-whole-output-on-console | |
let alignColorsAndTime = winston.format.combine( | |
winston.format.colorize({ | |
all:true | |
}), | |
winston.format.label({ | |
label:'[LOGGER]' |
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
git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches | |
## source: https://dev.to/pradumnasaraf/beautify-your-git-log-with-a-single-command-2i5 |
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 { default: axios } = require("axios"); | |
const fs = require("fs"); | |
const downloadFile = async (url, filename) => { | |
const { data, headers, request } = await axios({ | |
url: url, | |
method: "GET", | |
responseType: "stream", | |
}); |
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
# https://dev.to/trilon/how-to-delete-all-nodemodules-folders-on-your-machine-43dh | |
$ cd documents | |
$ find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
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
// https://dev.to/stackfindover/how-to-integrate-webcam-using-javascript-3fji | |
var StopWebCam = function () { | |
var stream = video.srcObject; | |
var tracks = stream.getTracks(); | |
for (var i = 0; i < tracks.length; i++) { | |
var track = tracks[i]; | |
track.stop(); | |
} |
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
var population = [ | |
{ | |
"year": "1850", | |
"age": "0", | |
"sex": "1", | |
"people": "1483789" | |
}, | |
{ | |
"year": "1850", | |
"age": "0", |
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
var Node = function(v, l, r) { | |
this.value = v; this.left = l || {}; this.right = r || {}; | |
} | |
Node.prototype.addChildren = function(number) { | |
if(number) { | |
if(this.value) { | |
Node.prototype.parent = this; | |
if(this.value > number) { | |
Node.prototype.direction = "left"; |
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
Basic | |
===== | |
[Shift]+[Mod]+[Enter] - launch terminal. | |
[Mod]+[b] - show/hide bar. | |
[Mod]+[p] - dmenu for running programs like the x-www-browser. | |
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master. | |
[Mod] + [j / k] - focus on next/previous window in current tag. |
NewerOlder