This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove message ad from facebook.com | |
// @namespace https://nohponex.gr/script/remove-facebook.com-messanger-ad/ | |
// @include https://www.facebook.com/* | |
// @version 0 | |
// @grant none | |
// @run-at document-end | |
// @noframes | |
// @updateUrl https://gist.github.com/nohponex/946b1e0e65c97b213702d25e05bb35ed/raw/ | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function flattenExceptionBacktrace(\Exception $exception) { | |
$traceProperty = (new \ReflectionClass('Exception'))->getProperty('trace'); | |
$traceProperty->setAccessible(true); | |
$flatten = function(&$value, $key) { | |
if ($value instanceof \Closure) { | |
$closureReflection = new \ReflectionFunction($value); | |
$value = sprintf( | |
'(Closure at %s:%s)', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sudo apt-get install cifs-utils | |
#sudo vim /etc/fstab | |
#sudo mkdir /media/osmc | |
#sudo mkdir /media/osmc/eXternal | |
#vim /home/nohponex/.smbcredentials | |
#username=msusername | |
#password=mspassword | |
#chmod 600 ~/.smbcredentials | |
//192.168.2.7/external /media/osmc/eXternal cifs credentials=/home/nohponex/.smbcredentials,iocharset=utf8,sec=ntlm,uid=1000,gid=1000,users 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name sis.auth.gr - Statistics per year | |
// @namespace nohponex | |
// @author NohponeX | |
// @description sis.auth.gr - Statistics per year | |
// @include https://sweng.it.auth.gr/unistudent/stud_CResults.asp* | |
// @include https://sw*.eng.auth.gr/unistudent/stud_CResults.asp?studPg=1* | |
// @updateURL https://gist.github.com/NohponeX/d0671d06251ef8970caa/raw/7b991c285dd43db116ac3c6297b2143d21b728ba/statistics_per_year.user.js | |
// @version 1 | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = function() { | |
this.onLoad = []; | |
}; | |
c.prototype.onLoadSubscribe = function(fn) { | |
this.onLoad.push(fn); | |
}; | |
c.prototype.unsubscribe = function(fn) { | |
this.onLoad = this.onLoad.filter( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(int argc, char **argv){ | |
struct timeval startwtime, endwtime; | |
gettimeofday (&startwtime, NULL); | |
//code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string = ""; | |
String.prototype.repeat = function( num ) | |
{ | |
return new Array( num + 1 ).join( this ); | |
}; | |
"αβγδεζηθικλμνξοπρστυφχψω".split('').forEach(function(l) { string+= l.repeat(179) + "\n"; }); | |
console.log(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tested on theme Scribbles2 | |
*/ | |
/** | |
* @param DOMParser doc DOM document | |
* @return array Returns all youtube video ids inside a DOM document | |
*/ | |
var parse_videos = function(doc) { | |
var embeds = doc.querySelectorAll('.post embed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cartesian() { //http://stackoverflow.com/a/15310051/2255129 | |
var r = [], arg = arguments, max = arg.length-1; | |
function helper(arr, i) { | |
for (var j=0, l=arg[i].length; j<l; j++) { | |
var a = arr.slice(0); // clone arr | |
a.push(arg[i][j]) | |
if (i==max) { | |
r.push(a); | |
} else | |
helper(a, i+1); |
NewerOlder