Skip to content

Instantly share code, notes, and snippets.

View xboston's full-sized avatar

Nikolay Kirsh xboston

View GitHub Profile
@revolunet
revolunet / angularjs.md
Last active April 21, 2025 07:22
BeerJS + AngularJS Paris le 25/2

AngularJS best ressources

Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)

Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !

@zwrss
zwrss / mapping.sh
Created March 18, 2013 15:31
Mappings for elasticsearch not nested stuff
#!/bin/sh
echo
curl -XDELETE 'http://localhost:9200/items'
echo
curl -XPUT 'localhost:9200/items' -d '
{
"mappings" : {
"Item" : {
"dynamic" : false,
@cmsx
cmsx / VideoThumb.php
Last active March 7, 2025 06:23
Класс для получения превью и информации о ролике RuTube, Vimeo, Youtube по ссылке.
<?php
/**
* Использование:
* $v = new VideoThumb($link);
* $v->getVideo(); //Ссылка на видео
* $v->getTitle(); //Название ролика
* $v->fetchImage($path) //Скачать самое большое превью ролика
*
* Прогнать тест:
{
"index": {
"analysis": {
"analyzer": {
"syns": {
"filter": [
"standard",
"lowercase",
"syns_filter"
],
@thomastheyoung
thomastheyoung / vast3_error_codes.md
Created June 10, 2013 09:05
VAST 3 error codes

VAST Error Codes Table

From VAST 3.0 Spec (PDF)

Code Description
100 XML parsing error.
101 VAST schema validation error.
102 VAST version of response not supported.
200 Trafficking error. Video player received an Ad type that it was not expecting and/or cannot display.
@chrisboulton
chrisboulton / ip_blacklist.lua
Last active September 19, 2024 15:42
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@nicolashery
nicolashery / elasticsearch.md
Last active December 30, 2023 19:03
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@gsouf
gsouf / AuthController.php
Last active April 9, 2021 00:25
oAuth with Phalcon and PHPoAuthLib
<?php
namespace Controllers;
use OAuth\Common\Service\AbstractService;
use OAuth\Common\Storage\Session as OAuthSession;
class AuthController extends ControllerBase {
// everytime we enter the controller, then we check for login, if yes, then we dont have to access here (except logout)
@bendo01
bendo01 / AppMenus.php
Last active December 25, 2015 17:39
trying to create tree behavior
<?php
namespace xPDPT\Models\AppSystem;
class AppMenus extends \Phalcon\Mvc\Model
{
protected $node;
protected $properties;
protected $children = array();
@altapo
altapo / config.php
Last active December 25, 2015 18:39
Вариант реализации мультиязычности в Phalcon
$settings = [
'language' => [
'ru' => 'Русский',
'en' => 'English'
]
];