Skip to content

Instantly share code, notes, and snippets.

View vlrmprjct's full-sized avatar
🎹
Boing boom tschak!

Thomas vlrmprjct

🎹
Boing boom tschak!
View GitHub Profile
@vlrmprjct
vlrmprjct / simple_web_server.txt
Created August 18, 2013 07:59
Simple Webserver
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; \
cat Dateiname; } | nc -l 8080; done
@vlrmprjct
vlrmprjct / mimetype_array.php
Last active June 20, 2018 21:22
Mimetype Array #php
$mime_types = array("323" => "text/h323",
"acx" => "application/internet-property-stream",
"ai" => "application/postscript",
"aif" => "audio/x-aiff",
"aifc" => "audio/x-aiff",
"aiff" => "audio/x-aiff",
"asf" => "video/x-ms-asf",
"asr" => "video/x-ms-asf",
"asx" => "video/x-ms-asf",
"au" => "audio/basic",
@vlrmprjct
vlrmprjct / checkmobile.html
Created March 20, 2014 10:55
Check if is mobile device (Example)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/>
<title>jQuery Device Orientation</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$.noConflict();
@vlrmprjct
vlrmprjct / change_user_after_commit.sh
Last active November 5, 2023 09:50
Useful GIT commands #git
git commit --amend --author="John Doe <john@doe.org>"
@vlrmprjct
vlrmprjct / getmail.js
Created August 5, 2014 07:57
Function to grab emailadresses from plaintext content.
/**
* FUNCTION TO GRAB EMAILADRESSE FROM ANY PLAINTEXT
* @param text
* @returns {*|Array|{index: number, input: string}}
*/
var getEmail = function(text) {
return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
}
@vlrmprjct
vlrmprjct / global.js
Created September 22, 2014 16:03
findurl's in string
function findUrls( text )
{
var source = (text || '').toString();
var urlArray = [];
var url;
var matchArray;
// Regular expression to find FTP, HTTP(S) and email URLs.
var regexToken = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g;
@vlrmprjct
vlrmprjct / url.js
Created October 14, 2014 10:03
How to get current url in JavaScript and jQuery ?
var testurl = http://www.test.com:8082/index.php#tab2?foo=123
// In Javascript:
window.location.host www.test.com:8082
window.location.hostname www.test.com
window.location.port 8082
window.location.protocol http
window.location.pathname index.php
@vlrmprjct
vlrmprjct / attr_selector.js
Created November 18, 2014 08:54
jQuery attr Selector
$('a[href$="ABC"]').foobar();
// http://docs.jquery.com/Selectors
// For attributes:
// = is exactly equal
// != is not equal
// ^= is starts with
// $= is ends with
@vlrmprjct
vlrmprjct / browser_dedect.js
Created January 14, 2015 16:50
Javascript Browser Detection
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "Other";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
},
searchString: function (data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
this.versionSearchString = data[i].subString;
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #