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 | |
$strTargetDir = "user_images/"; | |
$fileUploadField = "file_name"; | |
$max_image_width = 600; | |
$max_image_height = 600; | |
$max_image_size = 1 << 20; // 1 MiB | |
$error_msg = ""; | |
// .... |
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
if (location.hostname != "m.facebook.com") { | |
alert("Not a m.facebook.com site"); | |
return; | |
}; | |
if (location.pathname == "/story.php") { | |
var authorId, itemId; | |
location.search.substr(1) | |
.split("&").forEach(function(pair) { | |
var p = pair.split("="); | |
if (p[0] == "story_fbid") itemId = p[1]; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 findURLs = (function() { | |
var bracketBalance = function(text) { | |
var brackets = { | |
"(": 1, | |
")": -1, | |
"[": 100, | |
"]": -100, | |
"{": 10000, | |
"}": -10000 | |
}, |
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
\b | |
(?: | |
(?:(https?|ftp)://|www\.)(?:[a-zа-я0-9-]+\.)*[a-zа-я0-9]+ | |
| | |
(?:[a-zа-я0-9][a-zа-я0-9-]*\.)+(?:ru|com|net|org|рф)(?![\w-]) | |
) | |
[^<>\s]* | |
(?: | |
(?<![[:punct:]]) | |
| |
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
javascript:(function(){var p=document.body.querySelector(".plp_photo"); if(p){window.open(p.src,"_blank")}else{alert("Image not found");}})() |
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
javascript:(function(){document.body.appendChild(document.createElement('script')).src="https://cdn.rawgit.com/davidmz/BetterFeed/v1.9.4/build/better-feed.user.js";})(); |
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
// Если канал открыт, то производится обычная (возможно блокирующая) запись. | |
// Если канал закрыт, то функция сразу и без паники возвращает управление. | |
// По возвращаемому функцией значению можно определить, была ли произведена запись. | |
func TrySend(it interface{}, itChan interface{}) (sent bool) { | |
itVal := reflect.ValueOf(it) | |
itChanVal := reflect.ValueOf(itChan) | |
itChanValT := itChanVal.Type() | |
if itChanValT.Kind() != reflect.Chan { | |
panic("Non-channel type") |
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
package bcast | |
type Broadcaster interface { | |
// Неблокирующая отправка сообщения | |
Send(interface{}) | |
// Блокирующее получение одного сообщения | |
Fetch() interface{} | |
} | |
type bcaster struct { |
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 (undefined) { | |
"use strict"; | |
var | |
isArray = Array.isArray || function (v) { | |
return Object.prototype.toString.call(v) === "[object Array]"; | |
}, | |
isFunction = function (v) { | |
return Object.prototype.toString.call(v) === "[object Function]" | |
}, |