Skip to content

Instantly share code, notes, and snippets.

@DanielSWolf
DanielSWolf / Program.cs
Last active June 13, 2024 17:26
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@lupikovoleg
lupikovoleg / gist:e1e1352465d6aa71aa01
Created January 14, 2015 13:18
Delete all VK wall posts.
javascript:var h = document.getElementsByClassName("post_actions");var i = 0;function del_wall(){var fn_str = h[i].getElementsByTagName("div")[0].onclick.toString();var fn_arr_1 = fn_str.split("{");var fn_arr_2 = fn_arr_1[1].split(";");eval(fn_arr_2[0]);if(i == h.length){clearInterval(int_id)}else{i++}};var int_id=setInterval(del_wall,1000);
@DTFagus
DTFagus / analyse_watchers.js
Created August 12, 2014 14:22
Bookmarklet to analyse angular watchers
javascript: (function() {
var root = $(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];
@robnyman
robnyman / arraybuffer-blob-filereader-localStorage.js
Last active January 30, 2024 09:22
Get file as an arraybuffer, create blob, read through FileReader and save in localStorage
// Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob
var rhinoStorage = localStorage.getItem("rhino"),
rhino = document.getElementById("rhino");
if (rhinoStorage) {
// Reuse existing Data URL from localStorage
rhino.setAttribute("src", rhinoStorage);
}
else {
// Create XHR, Blob and FileReader objects
var xhr = new XMLHttpRequest(),