Skip to content

Instantly share code, notes, and snippets.

View shamanNS's full-sized avatar

Predrag Đokić shamanNS

View GitHub Profile
# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
@adam-p
adam-p / Local PR test and merge.md
Last active April 1, 2025 20:23
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@nolanlawson
nolanlawson / protips.js
Last active November 19, 2024 02:40
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@rfletcher
rfletcher / lastfm-dedupe.js
Created February 16, 2016 14:39
Bookmarklet to remove duplicates from your Last.FM track list
/**
* Bookmarklet to remove duplicate entries from your Last.FM track list.
*
* Bookmarklet version:
* javascript:(%20function()%20{var%20row_to_title%20=%20function(%20$tr%20)%20{return%20$tr.find(%20%22.chartlist-name%20a:not(:empty)[title*=%E2%80%94]%22%20).attr(%20%22title%22%20).replace(%20/\s+/g,%20%27%20%27%20);};jQuery(%20%22table.chartlist%20>%20tbody%20>%20tr%22%20).each(%20function()%20{var%20$tr%20=%20jQuery(%20this%20),$siblings%20=%20jQuery(%20$tr.nextAll(%20%22tr%22%20).slice(%200,%206%20)%20),current_title%20=%20row_to_title(%20$tr%20);$siblings.each(%20function()%20{var%20$sibling%20=%20jQuery(%20this%20),sibling_title%20=%20row_to_title(%20$sibling%20);if(%20sibling_title%20!==%20%22%22%20&&%20current_title%20===%20sibling_title%20)%20{console.log(%20%22Removed%20%22%20+%20sibling_title%20);$sibling.find(%20%22.chartlist-delete%20form%20[type=submit]%22%20).click();return%20false;}});}%20);}()%20);
*
* Full version:
*/
( function() {
var row_to_title = function( $tr ) {
@c-kick
c-kick / hnl.mobileConsole.js
Last active March 18, 2025 22:30
NOTE: V2 Released! Seehttps://github.com/c-kick/mobileConsole hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
*
* NEW VERSION AT https://github.com/c-kick/mobileConsole
*
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
@taoalpha
taoalpha / deleteKindleItems.js
Last active September 12, 2016 22:50
delete kindle items
// bulk deletion for kindle items
function deleteKindleItems() {
if ($('.contentListIcon_myx').length > 0) {
// select first 10
$('.contentListIcon_myx').map(function(i,v){ if (i < 10) {$(v).click()}else{return}});
// delete
$('#contentAction_delete_myx').click();
// yes to delete
@ruario
ruario / intro-latest-widevine.md
Last active January 29, 2024 07:53
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@enzanki-ars
enzanki-ars / update-ffmpeg-rpi.sh
Last active December 4, 2023 21:36
Install/Update FFmpeg with hardware acceleration on the Raspberry Pi
#!/bin/bash
# #########################################################
#
# WW WW AAA RRRRRR NN NN IIIII NN NN GGGG
# WW WW AAAAA RR RR NNN NN III NNN NN GG GG
# WW W WW AA AA RRRRRR NN N NN III NN N NN GG
# WW WWW WW AAAAAAA RR RR NN NNN III NN NNN GG GG
# WW WW AA AA RR RR NN NN IIIII NN NN GGGGGG
#
@rainabba
rainabba / config-docker.sh
Last active September 6, 2022 03:46
Install docker-ce, docker-compose and docker-sync in Ubuntu for WSL
#!/bin/bash
#
#This script assumes very little other than a fresh Ubuntu install (using the Windows store) on Win10 1709 or newer with WSL installed already
#In Powershell, run the following to install WSL and Ubuntu
#
#Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
#Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.zip -UseBasicParsing
#Expand-Archive ~/Ubuntu.zip ~/Ubuntu
#~/Ubuntu/ubuntu.exe
#
@ruario
ruario / 1-README.md
Last active August 8, 2024 12:41
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)