Skip to content

Instantly share code, notes, and snippets.

@TheAnonymous
TheAnonymous / pom.xml
Last active August 10, 2017 07:45
Example for Maven + Node stuff
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>delete email stuff</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
@TheAnonymous
TheAnonymous / test_if_element_in_viewport.html
Created June 3, 2016 08:32
This is an example how to test if an element is in viewport.
<!DOCTYPE html>
<html>
<header>
<meta charset="utf-8"/>
<title>Test if element is in viewport</title>
</header>
<body>
</body>
import numpy as np
import cv2
#from matplotlib import pyplot as plt
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FPS, 20)
# Define the codec and create VideoWriter object
#fourcc = cv2.cv.CV_FOURCC(*'DIVX')
###width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH) + 0.5)
###height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT) + 0.5)
@TheAnonymous
TheAnonymous / AngularFireUpload.js
Created July 20, 2015 07:00
Example code for Firebase with AngularJS to upload a image.
var refImg = new Firebase("https://YOURURL.firebaseio.com/images/" + $rootScope.authData.uid);
var ImgObj = $firebaseObject(refImg);
function saveimage(e1) {
var filename = e1.target.files[0];
var fr = new FileReader();
fr.onload = function (res) {
$scope.image = res.target.result;
ImgObj.image = res.target.result;
@TheAnonymous
TheAnonymous / WebsiteWatcher.gs
Created July 4, 2015 07:50
This is a Google Apps Script to monitor dom elements at a website if they change you will get an email.
function initSheets(sps){
var Emailsheet;
try{
Emailsheet = sps.getSheetByName("emaillist");
} catch(e){
sps.insertSheet("emaillist")
Emailsheet = sps.getSheetByName("emaillist");
Emailsheet.getRange("A1").setValue("examplemail@examplemail.com")
}
@TheAnonymous
TheAnonymous / configure.sh
Created June 28, 2015 20:12
This is a small script to configure git via easybashgui
#!/usr/bin/env bash
source easybashgui
export supertitle="Git Konfiguration"
#
#####
#
ok_message "Willkommen.\nDieser GUI soll beim ersten einrichten helfen.Für Verbesserungsvorschläge bitte ein Issue auf Github aufmachen.\nBitte gebe im folgenden reale Daten an da diese in den Commitmessages erscheinen.\nViel Erfolg!"
#
#####
#
import os, re,asyncfile, jester, asyncdispatch, htmlgen, asyncnet, net, browsers, parseutils, strutils, parseopt2
echo "\"./upload insecure\" to share also subdirectorys"
echo "\"./upload 5000\" to serve on port 5000"
echo "\"./upload insecure 5000\" to share also subdirectorys and serve on port 5000"
var port = 8080
var insecure_world = false
var html_temp = ""
html_temp.add "<link href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css\" rel=\"stylesheet\">"
@TheAnonymous
TheAnonymous / Fractals_growing.cpp
Created April 23, 2015 15:03
This is a small C++ programm to simulate growing fractals.
#include <opencv2/opencv.hpp>
#include <vector>
#include <random>
#include <iostream>
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <unistd.h>
<html>
<head>
<title>My first Three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js"></script>
curl "http://192.168.178.1:49000/upnp/control/WANIPConn1" -H 'Content-Type: text/xml; charset="utf-8"' -H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping' -d '<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body><u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"><NewRemoteHost /><NewExternalPort>44</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>55</NewInternalPort><NewInternalClient>192.168.178.55</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription /><NewLeaseDuration>0</NewLeaseDuration></u:AddPortMapping></s:Body> </s:Envelope>'
curl "http://192.168.1.xxx:49000/upnp/control/WANIPConn1" -H 'Content-Type: text/xml; charset="utf-8"' -H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#DeletePortMapping' -d '<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap