Skip to content

Instantly share code, notes, and snippets.

@k1000
k1000 / proof-of-virginity-vocab.md
Last active March 17, 2023 16:03
Proof of Virginity - VC
@k1000
k1000 / pdf_unprotect.sh
Created July 20, 2012 16:07
PDF DRM password removal
#remove DRM http://ubuntuforums.org/showthread.php?t=884002
gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=temp.pdf foo.pdf -c '.setpdfwrite' && mv temp.pdf foo.pdf
#remove password http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
@k1000
k1000 / aiports.py
Created July 26, 2011 07:46
list of world aiports with codes
# -*- coding: utf-8 -*-
def get_airports():
airports = sorted(AIRPORTS, key=lambda airport: airport[0]) #sortear por el país
return [(a[2] , "%s - %s (%s)" % (a[0], a[1], a[2]) ) for a in airports]
AIRPORTS = [
( "Denmark", "Aalborg", "AAL" ),
( "Norway", "Aalesund", "AES" ),
( "Denmark - Bus service", "Aarhus", "ZID" ),
( "Denmark - Tirstrup", "Aarhus", "AAR" ),
@k1000
k1000 / index.js
Last active March 16, 2021 18:59
implementation Marvel API, mongodb, Auth0 (Github)
const crypto = require("crypto");
const fetch = require('node-fetch');
const express = require('express');
const lusca = require('lusca');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const session = require('express-session');
const passport = require('passport');
const GithubStrategy = require('passport-github').Strategy;
require('dotenv').config();
@k1000
k1000 / index.js
Created March 16, 2021 13:17
marvelouz
const express = require('express')
const crypto = require("crypto");
const fetch = require('node-fetch');
const mongoose = require('mongoose');
const { auth } = require('express-openid-connect');
require('dotenv').config();
const PORT = process.env.PORT || 5000
const mongo_uri = `mongodb+srv://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@cluster0.u4tzh.mongodb.net/myFirstDatabase?retryWrites=true&w=majority`;
import {AsyncStorage } from 'react-native';
import {Actions} from 'react-native-router-flux';
import Calendar from '../app/calendar';
const moment = require('moment');
const callib = require('./callib.js');
const aspects = require('../data/favorable_days.json');
const constellations = require('../data/constellations.json');
const signsByNum = require('../data/signs_num.json');
const signsByName = require('../data/tib_signs.json');
# FUNK from https://colab.research.google.com/drive/12rWn1enSZP6OTgYgRT1OYFhFnt7QFfIu#scrollTo=dwe_prwCn2HH
def moving_average(df, n):
MA = pd.Series(df['Close'].rolling(n, min_periods=n).mean(), name='MA_' + str(n))
df = df.join(MA)
return df
def exponential_moving_average(df, n):
EMA = pd.Series(df['Close'].ewm(span=n, min_periods=n).mean(), name="EMA_" + str(n))
df = df.join(EMA)
@k1000
k1000 / git-rm-from-history.sh
Created August 17, 2011 09:04
permanently delete files/folders from your git repository
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
// remove hard spaces
let bodyHTML = document.body.innerHTML;
bodyHTML = bodyHTML.replace(/ /gim, ' ');
bodyHTML = bodyHTML.replace(/\u00a0/gim, ' '); //  
bodyHTML = bodyHTML.replace(' ', ' ');
bodyHTML = bodyHTML.replace(/<[^/>]+>[ \n\r\t]*<\/[^>]+>/gim, ''); // remove empry tags
bodyHTML = bodyHTML.replace(/,([^ ])/gim, ', $1'); // fixes commas not followed by space
//bodyHTML = bodyHTML.replace(/”([^ ])/gim, '” $1'); // fixes not followed by space
//bodyHTML = bodyHTML.replace(/\.([^ <\d])/gim, '\. $1'); // fixes dot stops not followed by space
//bodyHTML = bodyHTML.replace(/\:([^ ])/gim, '\: $1');
@k1000
k1000 / ubuntu_after_install.sh
Last active October 13, 2018 09:01
ubuntu after install
#http://smashingweb.info/things-to-do-after-installing-ubuntu-12-04-for-perfect-desktop/
# scribus
sudo apt-add-repository ppa:scribus/ppa
# inkscape
sudo apt-add-repository ppa:inkscape-nightly/ppa