Skip to content

Instantly share code, notes, and snippets.

@thevladsoft
thevladsoft / download-java8.sh
Created May 28, 2019 15:49 — forked from hgomez/download-java8.sh
wget to download Java 8
wget --continue --no-check-certificate -O jdk-8-linux-x64.tar.gz --header Cookie: oraclelicense=a http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.tar.gz
@thevladsoft
thevladsoft / 159155-git.xml
Created April 12, 2018 13:19
The idea is to be able to use kate/kwrite for committing with git.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language>
<language name="git_commit" version="1.24" kateversion="2.4" section="Other" extensions=".git/COMMIT_EDITMSG" mimetype="" >
<highlighting>
<!-- Listas de palabras (keywords) a resaltar -->
<!-- <list name="somename">
<item>commit</item>
<item>committed</item>
</list>-->
<!-- Contexto dice como formatear las palabas que esten dentro de un contexto -->
@thevladsoft
thevladsoft / simplehttpserver.py
Created January 9, 2018 13:47 — forked from csaki/simplehttpserver.py
Simple Python Http Server with Upload and Authentication
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.1"
__all__ = ["SimpleHTTPRequestHandler"]
@thevladsoft
thevladsoft / springer-free-maths-books.md
Created December 28, 2015 18:39 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@thevladsoft
thevladsoft / watch
Last active August 29, 2015 14:17 — forked from lucaswerkmeister/watch
#!/bin/bash
url="${1:?Usage: $0 url [recipient...]}"
shift
sha=$(curl -s $url | shasum);
while [[ $sha = $(curl -s $url | shasum) ]]; do
sleep 15;
done
sendmail=$(type -p sendmail || { [[ -x /usr/sbin/sendmail ]] && echo /usr/sbin/sendmail || { echo "Can’t find sendmail!"; exit 1; }; });
$sendmail -F 'Website Watcher Bot' -f "bot+watcher@$HOSTNAME" "${@:-mail@$HOSTNAME}" << EOF
Subject: Website changed
@thevladsoft
thevladsoft / map3d
Created February 6, 2015 14:20
map3d
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "",
"signature": "sha256:aecce6777cf7e23c92a9449e867643c7351a0a2980892e0ee5d59babd495b1be"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
# -*- coding: utf-8 -*-
"""C magic.
This is a very simple magic for compiling and importing C code with ctypes.
This derives from biteymagic.py, by Bradley Froehle:
https://gist.github.com/bfroehle/3458310
You must provide the function names you would like exported.
"""
Module for IPython to display code with TeX representation.
This makes for example the following workflow possible:
.. sourcecode:: ipython
In [1]: %load_ext py2tex
In [2]: from math import *
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thevladsoft
thevladsoft / Basic linear regression.py
Last active December 25, 2015 19:59
# Calculates the linear regression model and plots the data # Limitations: only returns the most basic regression outputs
from scipy import stats
import numpy as np
import pylab
# Fit the model
x = np.array([1, 2, 5, 7, 10, 15])
y = np.array([2, 6, 7, 9, 14, 19])
slope, intercept, r_value, p_value, slope_std_error = stats.linregress(x, y)
# Calculate some additional outputs