Skip to content

Instantly share code, notes, and snippets.

View knyga's full-sized avatar
🇺🇦

Oleksandr Knyga knyga

🇺🇦
View GitHub Profile
@knyga
knyga / mizzle - generate content table
Last active August 29, 2015 13:55
Mizzle - получить список товаров со страницы агрегатора или категорий
var Product = function($dom) {
this.id = /\/product\/(\d+)/.exec($dom.find('a:last').attr('href'))[1];
this.name = $dom.find('a:last').text();
this.href = $dom.find('a:last').attr('href')
if (this.href.indexOf('http') < 0) {
this.href = "http://mizzle.ru" + this.href;
}
};
@knyga
knyga / adscodes__280214
Last active August 29, 2015 13:56
Adsense armorgames codes
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- armorgames, 728x90 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-0350114752821968"
data-ad-slot="6629306714"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@knyga
knyga / gist:9558652
Created March 14, 2014 22:50
Freelansim.ru, get emails by keyword [outofdate]
var request = "http://freelansim.ru/freelancers?freeonly=true&page=<?%page%?>&q=ruby+on+rails",
pcount = $('.gap').next().text() || 5,
emails = [];
var stat = {
cur: 0,
total: 0,
left: function() {
return this.total - this.cur;
}
};
#!/bin/sh
DateDir=`date +"%d.%m.%Y"`
createdir()
{
if [ ! -d $1 ]
then
mkdir $1
fi
}
{
"id": 2,
"name": "Death Star",
"thumb": "/uploads/slides/thumbs/1131.png",
"onCreated": 1398222222,
"onUpdated": 1398249206,
"onPublished": 1398258112,
"author": "Oleksandr Knyga",
"editor": "Marjam Holy",
"startState": 11,
@knyga
knyga / gist:7ab58c1608423fb5924e
Created May 10, 2014 15:57
Armor-games - 336x280
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Armorgames, 336x280 -->
<ins class="adsbygoogle"
style="display:inline-block;width:336px;height:280px"
data-ad-client="ca-pub-0350114752821968"
data-ad-slot="3675840310"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@knyga
knyga / gist:b94cf4a11f39c9ee8f8f
Created May 10, 2014 21:34
Armor-games ссылочные блоки
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Armor-games -->
<ins class="adsbygoogle"
style="display:inline-block;width:468px;height:15px"
data-ad-client="ca-pub-0350114752821968"
data-ad-slot="1243309512"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@knyga
knyga / Wifi checker
Created January 7, 2015 11:15
Automatically reconnects to wifi
@set @x=0; /*
@echo off
SetLocal EnableDelayedExpansion
ver |>NUL find "6." && if "%1" neq "Admin" (
cscript.exe //nologo //e:jscript "%~f0"
Exit
)
:begin
@knyga
knyga / actionrandom
Last active December 29, 2015 16:48
Generates random data for invideo
var choise = {
random: function(min, max) {
return Math.floor(min + Math.random() * (max - min));
},
getName: function() {
var data = [
"Hammond",
"Holland",
"Sandoval",
"Rodgers",
const express = require(‘express’);
const app = express();
const http = require(‘http’).Server(app);
const io = require(‘socket.io’)(http);
// middleware for static processing
app.use(express.static(__dirname + ‘/static’));
// web socket connection event
io.on(‘connection’, function(socket){
console.log(‘connection’);
});