Skip to content

Instantly share code, notes, and snippets.

View diniremix's full-sized avatar

Jorge Brunal diniremix

View GitHub Profile
@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

@xtian
xtian / .editorconfig
Last active January 14, 2021 21:58
Rust .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*.rs]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
@tagplus5
tagplus5 / imageToText.gs
Created December 18, 2015 18:02
google apps script image to text ocr
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
@x3rAx
x3rAx / .gitignore
Created August 6, 2015 20:36
Gitignore with .gitkeep
# +----------------------------+
# | IDE files |
# +----------------------------+
/.idea
# +----------------------------+
# | Vagrant |
# +----------------------------+
/.vagrant
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@jamiekurtz
jamiekurtz / gist:d325baa979dd3f64f8d1
Created March 6, 2015 03:54
Install Kazam on Fedora
# 1. download zip from https://launchpad.net/kazam
# 2. extract into target folder
# install prerequisites (works on Fedora 21 with Python 3)
sudo yum install python3-distutils-extra python3-dbus intltool
# run the included setup from within the unzipped folder
sudo python3 setup.py install
# Done! Can start with either `kazam` command or find Kazam in the menu
@diniremix
diniremix / pulse.sh
Last active August 29, 2015 14:15
a simple script to generate skeletons for Web applications
#/bin/sh
PULSEPHP_URL="https://github.com/diniremix/pulsePHP/archive/master.zip"
PULSEJS_URL="https://gist.githubusercontent.com/diniremix/8df589843792342197cd/raw/deebde566b25316fc39c8da5a18a4eeb9e88efa4/pulseJS.js"
TEST_DIR="./test"
APP_DIR="./js"
function help(){
echo;
echo -e "\e[1;97mpulse\e[0m - a simple script to generate skeletons for Web applications";
@cferdinandi
cferdinandi / extend.js
Last active August 17, 2023 23:26
A native JS extend() function.
/**
* Merge defaults with user options
* @private
* @param {Object} defaults Default settings
* @param {Object} options User options
* @returns {Object} Merged values of defaults and options
*/
var extend = function ( defaults, options ) {
var extended = {};
var prop;
@chrisveness
chrisveness / utf8-regex.js
Last active May 25, 2023 01:53
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} unicodeString - Unicode string to be encoded as UTF-8.
@mariocesar
mariocesar / app_granite.py
Last active June 29, 2021 08:35
Python GTK3 desktop app and Granite App (Elementary OS Desktop)
import sys
from gi.repository import Granite
from gi.repository import Gtk
from gi.repository import Gio
class LightWindow(Gtk.Dialog):
def __init__(self):
super(LightWindow, self).__init__()