Skip to content

Instantly share code, notes, and snippets.

Marina Lohova marinalohova

Block or report user

Report or block marinalohova

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9b4cbccf4bcecb03fc7af4f5158c5874
<link href="/wp-content/plugins/wp-supersized/theme/supersized.shutter.css?ver=4.2.2" id="supersized_theme_css-css" media="all" rel="stylesheet" type="text/css"></link>
<script src="/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4" type="text/javascript"></script>
<script src="/wp-content/plugins/wp-supersized/js/jquery.easing.min.js?ver=1.3" type="text/javascript"></script>
<script src="/wp-content/plugins/wp-supersized/js/jquery.easing.compatibility.js?ver=1.0" type="text/javascript"></script>
<script src="/wp-content/plugins/wp-supersized/js/jquery.animate-enhanced.min.js?ver=0.75" type="text/javascript"></script>
<script type='text/javascript' src='/wp-content/plugins/wp-supersized/js/supersized.3.2.7.min.js?ver=3.2.7'></script>
View gist:0bf05af9b20f7b585c1758c6386227ed
//precalc all distances to major research cities after import and store to respondents database/elastic
function precalcDistance(respondents, majorCities) {
return respondents.map((respondent) => {
let distances = majorCities.reduce((memo, {location}) => {
let distance = haversine(location.location, respondent);
memo[location.city] = distance;
return memo;
}, {});
@marinalohova
marinalohova / index.js.jsx
Created Apr 20, 2016
Why not use jQuery shorthands for ajax requests?
View index.js.jsx
filterNetworks(value) {
$.ajax({
url: this.props.url,
data: {
network: network,
page: pageNumber||1,
search: search
},
dataType: 'json',
success: function (carts) {
View watch.html
<html>
<head>
<title>Red5 Demo - Simple Subscriber</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("simpleSubscriber.swf", "myContent", "360", "240", "8.0.0", "assets/expressInstall.swf");
</script>
<style media="screen" type="text/css">#myContent {
visibility: hidden
View broadcast.html
<html>
<head>
<title>Red5 Demo - Simple Broadcaster</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("simpleBroadcaster.swf", "myContent", "360", "240", "8.0.0", "jwplayer/expressInstall.swf");
</script>
<style media="screen" type="text/css">#myContent {
visibility: hidden
View bash
> export PATH="/path/to/mtasc-mx/bin:/path/to/mtasc-mx/std:$PATH"
> cd "/path/to/red5/classes"
> mtasc -cp "." -swf ../simpleBroadcaster.swf -mx org/red5/samples/livestream/broadcaster/Main.as -v
> mtasc -cp "." -swf ../simpleSubscriber.swf -mx org/red5/samples/livestream/broadcaster/Main.as -v
@marinalohova
marinalohova / org.red5.samples.livestream.broadcaster.Main
Created Apr 8, 2016
org.red5.samples.livestream.broadcaster.Main
View org.red5.samples.livestream.broadcaster.Main
public function configUI():Void
{
disconnect._visible = false;
connect._visible = false;
uri._visible = false;
light._visible = false;
connection = new Connection();
light.registerNC(connection);
if (makeConnection(Connector.red5URI)) {
@marinalohova
marinalohova / org.red5.utils.Connector
Last active Apr 7, 2016
org.red5.utils.Connector
View org.red5.utils.Connector
// UI Elements:
// ** AUTO-UI ELEMENTS **
private var alert:SimpleDialog;
private var connect:IconButton;
private var disconnect:IconButton;
private var light:ConnectionLight;
private var uri:TextInput;
// ** END AUTO-UI ELEMENTS **
public function configUI():Void
@marinalohova
marinalohova / org.red5.samples.livestream.broadcaster.Main
Last active Apr 7, 2016
org.red5.samples.livestream.broadcaster.Main
View org.red5.samples.livestream.broadcaster.Main
private function configUI():Void
{
// setup the tooltip defaults
Tooltip.options = {size:10, font:"_sans", corner:0};
// setup cam
cam = Camera.get();
cam.setMode(480, 320, 15);
cam.setQuality(0,80);
// setup mic
mic = Microphone.get();
@marinalohova
marinalohova / install_psql_php.sh
Last active Aug 29, 2015 — forked from giorgiofellipe/install_psql_php.sh
Install PHP PGSQL extensions on Mac OS X Yosemite (change PHP_VER with your PHP version)
View install_psql_php.sh
PHP_VER="5.5.20"
brew install wget
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
You can’t perform that action at this time.