Skip to content

Instantly share code, notes, and snippets.

@bewam
bewam / _facebook_sponsor_removal.user.js
Last active March 13, 2021 22:11
UserScipt to remove Sponsored feed posts in Facebook 2021
// ==UserScript==
// @name _facebook
// @namespace js.userscript.bewam
// @include https://*.facebook.com/*
// @include https://facebook.com/*
// @run-at document-start
// @version 1.1.0_2021-02-07
// @grant none
// ==/UserScript==
@bewam
bewam / gist:8cc70df003d5815b4471af3937fd082f
Last active January 27, 2021 19:01
A quick script to backup a file in bash. Install to /usr/local/backup-file.sh, and make it executtable. Can comment, just ask what you don't get.
#!/bin/env bash
#### USAGE
#### =====
## (this script) FILEtoBEBackedup
#### settings
#### ========
## destination folder
@bewam
bewam / gist:1456e0d91c63408cda6328c6c44c0065
Last active December 16, 2020 16:51
function to know hours in a range in javascript
// function to know hours in a range
const hoursRange = (s, e) =>Array.from({ length: (e>s)?(e-s):(24-s+e) }, (_,i)=>(s+i<24)?s+i:s+i-24);
console.log(hoursRange(18,22))
// Array(4) [ 18, 19, 20, 21 ]
console.log(hoursRange(18,6))
// Array(6) [ 22, 23, 0, 1, 2, 3 ]
@bewam
bewam / update_sourceforge_plantuml
Last active January 21, 2018 14:24
simple bash script that download new plantuml release and link it to update you jar file
#!/bin/bash
## it downloads the rss and parse it,
## check if update, downloads the new release
## replaces link from old .jar to new one
## erases unenecessary stuff: temp., old jar(if asked)
## this script REQUIRE the use of a
## xml parser, here xqilla
target_dir="$HOME/bin/" # absolute for linking
@bewam
bewam / update_github_release
Last active January 16, 2018 19:28
bash file to update the lastest release of a project strored on github
#!/bin/bash
## This script intents to be used with a schedule program like cron.
## There is a few input to setup, don't hesitate to make it verbose.
## You'll use it WITHOUT ANY WARANTY of any kind, you have to
## know what you're doing.
## Remember to modify the installation program to suit your system.
## you need:
## jq installed to parse the api response of github api
## wget installed to download