Skip to content

Instantly share code, notes, and snippets.

View Eboubaker's full-sized avatar
🐐

E. Bekkouche Eboubaker

🐐
  • 05:40 (UTC +01:00)
View GitHub Profile
@gunvirranu
gunvirranu / Vector2D.java
Created March 17, 2017 07:03
Complete 2D Vector Class for Java
public class Vector2D {
public double x;
public double y;
public Vector2D() { }
public Vector2D(double x, double y) {
this.x = x;
@rodrigoborgesdeoliveira
rodrigoborgesdeoliveira / ActiveYouTubeURLFormats.txt
Last active March 29, 2026 06:20 — forked from ScottCooper92/gist:ea11b690ba4b1278e049
Example of the YouTube videos URL formats
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://youtube.com/watch?v=-wtIMTCHWuI
http://m.youtube.com/watch?v=-wtIMTCHWuI
https://www.youtube.com/watch?v=lalOy8Mbfdc
https://youtube.com/watch?v=lalOy8Mbfdc
https://m.youtube.com/watch?v=lalOy8Mbfdc
http://www.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
http://m.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail
@izhangzhihao
izhangzhihao / Option.java
Created May 25, 2018 07:17
Optional of throwable
import java.util.Optional;
import java.util.function.Function;
public class Option {
public static <T, V> Optional<V> ofThrowable(T it, Function<T, V> func) {
try {
return Optional.ofNullable(func.apply(it));
} catch (Exception e) {
return Optional.empty();
}
@paulera
paulera / youtube_ad_skipper.js
Last active September 16, 2021 12:25
Close youtube ads as soon as they show (video ads and banners)
// ==UserScript==
// @name AdSkipper
// @namespace https://gist.github.com/paulera/671daf5b9a5f6502697359941ba524dc
// @version 1.3
// @description Skip youtube ads automatically
// @author paulera
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@GLMeece
GLMeece / Steps_to_Terminal_Enlightenment_on_a_Mac.md
Last active February 26, 2026 20:17
Steps to Terminal Enlightenment on a Mac (tweaking your terminal for fun and profit)
@snehesht
snehesht / plink-plonk.js
Created February 16, 2020 01:26 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@galanteh
galanteh / install.sh
Last active April 2, 2023 18:13
Install Megatools on CentOS 7. Megatools are the commands to be used on linux
#!/bin/bash
yum -y install gcc make glib2-devel libcurl-devel openssl-devel gmp-devel tar automake autoconf libtool wget asciidoc
wget https://megatools.megous.com/builds/megatools-1.10.0-rc1.tar.gz
tar -xzvf megatools*.tar.gz
cd megatools*
./configure
make
make install
# megadl 'https://mega.nz/#xxxxxxxxxxx!'
@idiazroncero
idiazroncero / removeEmojis.php
Created June 12, 2020 06:55
Remove Emoji characters from a string (PHP)
// All credit goes to Ravikant Mane:
// Original comment: https://www.drupal.org/forum/support/post-installation/2013-07-16/removing-emoji-code#comment-11307453
// Preserve the question marks by converting them to '{%}' placeholders.
$string = str_replace("?", "{%}", $string);
// Encode to and from an encoding type that doesn't support emojis.
// This will convert all emojis to the same character, in this case "question mark".
$string = mb_convert_encoding($string, "ISO-8859-1", "UTF-8");
$string = mb_convert_encoding($string, "UTF-8", "ISO-8859-1");
@nhCoder
nhCoder / YTCipher.php
Last active February 27, 2022 16:49
Pulls the cipher signature decipher JS code from youtube. Youtube protects its videos using a cipher signature ,which is decoded by player before playing so to decrypt the cipher use the code below code to get the cipher code from YouTube and run it in WebView or JavaScript engine to decipher the signature. Demo : http://detectivec.de/ytcipher.php
<?php
function startsWith ($string, $startString)
{
$len = strlen($startString);
return (substr($string, 0, $len) === $startString);
}
$url="https://www.youtube.com/";
@yeputons
yeputons / build-run.sh
Last active March 8, 2024 19:25
Emscripten's embind's std::vector<std::string> example (tested with emscripten 2.0.6)
#!/bin/bash
em++ --bind cpp-code.cpp --post-js js-code.js -o output.js
node output.js