Skip to content

Instantly share code, notes, and snippets.

View JuanjoSalvador's full-sized avatar
🏠
Working from home

Juanjo Salvador JuanjoSalvador

🏠
Working from home
View GitHub Profile
@JuanjoSalvador
JuanjoSalvador / checkboxCounter.js
Last active May 23, 2016 10:47
Contador de checkboxes en JavaScript
function contar() {
var checkboxes = document.getElementById("test").checkbox; // Array de checkboxes
var cont = 0; // Checkboxes marcados, por defecto empieza la cuenta en 0
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
cont = cont++;
}
}
var porcen = (cont/checkboxes.length) * 100; // Porcentaje de checboxes marcados
@RainerAtSpirit
RainerAtSpirit / JekyllApps.js
Created July 9, 2012 12:18
Adding AngularJS search in Jekyll blog
/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(false);
});
JekyllApp.filter('highlight', function () {
return function (text, filter) {
@linuxct
linuxct / arch-shell.sh
Last active August 17, 2017 22:44 — forked from JuanjoSalvador/debian-shell.sh
Archlinux package managers shell aliases
# Place the content of this script at the bottom of your ~/.bashrc file (or ~/.zshrc if you are using ZSH).
# Please be ensure that your shell doesn't have any alias or plugin with the following names: paci, pacu, pacr, pacq, pacd, pacl
# Replace 'pacman' with 'pacaur' if you want to use it instead,
PMG="pacman"
if [ "$PMG" = "pacman" ]; then
ELEVATOR="sudo"
elif [ "$PMG" = "pacaur" ]; then
ELEVATOR=""
@JuanjoSalvador
JuanjoSalvador / chuckfacts.py
Last active August 25, 2017 11:34
Chuck Norris facts in Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
line = round(random.random() * 100 - 2)
facts = []
with open("quotes.txt", "r") as f:
@Soransik
Soransik / __init__.py
Last active November 7, 2017 18:06
Create Desktop Apps with HTML interface and Python
#/
# Server/
# /__init__.py
# /templates/
# /index.html
# app.pyw
# test_webview.py
from flask import Flask, render_template, request
app = Flask(__name__)
#/bin/bash
# Installs libfreetype6 2.8.0 into affected electron app.
# For more details ee:
# https://github.com/atom/atom/issues/15737
# https://github.com/Microsoft/vscode/issues/35675
CRT=$(dpkg-query --showformat='${Version}' --show libfreetype6)
CRT=$(echo $CRT | sed -e 's/-.*$//g')
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@Nixes
Nixes / Easy SQLite Gogs Installation for Ubuntu and Debian.md
Last active August 3, 2019 12:34
Easy SQLite Gogs Installation for Ubuntu and Debian

This is a tutorial that describes how to set up a private git (github) server for a smallish development team.

  • Download GOGS binary Zip File
  • Unzip to folder
  • Run: sudo apt-get install sqlite3
  • Run GOGS: ./gogs web
  • Goto install page: http://hostname:3000/install
  • Set to use sqlite3 as the database backend
  • Set USER to run as, preferrably not root if it will be internet facing.
  • Set Database file location (Make sure database file location is set to a folder where that same user has write permissions)
@JuanjoSalvador
JuanjoSalvador / downloader.py
Last active February 17, 2020 16:55
Extracts and decrypt a list of adf.ly links from a forum's post
# -*- coding: utf-8 -*-
import base64, requests, os, re, sys
from bs4 import BeautifulSoup
def _crack(code):
zeros = ''
ones = ''
for n,letter in enumerate(code):
@JuanjoSalvador
JuanjoSalvador / wine-installer.sh
Last active January 30, 2022 21:25
Script to install Wine Staging from WineHQ repositories (Debian)
#!/bin/bash
VERSIONS="buster|bullseye|bookworm"
BRANCHES="stable|devel|staging"
if [ "${UID}" -eq 0 ] ; then
ARCH=$(dpkg --print-architecture)
if [ "${ARCH}" == "amd64" ] ; then