Skip to content

Instantly share code, notes, and snippets.

View alxfv's full-sized avatar

Alexander Fedorov alxfv

View GitHub Profile
@alxfv
alxfv / ice_cube.ru.yml
Created December 25, 2015 08:20
Russian locale for ice_cube
ru:
ice_cube:
pieces_connector: ' / '
not: 'not %{target}'
not_on: 'not on %{target}'
date:
formats:
default: '%B %-d, %Y'
month_names:
-
@alxfv
alxfv / gist:0d8e7af175b7627fd526
Created June 15, 2015 20:22
avconv streaming to twitch
#! /bin/bash
# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
echo "Please create this file and copy past your stream key into it. Open this script for more details."
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package org.springframework.boot;
import java.lang.reflect.Constructor;
import java.nio.charset.Charset;
import java.security.AccessControlException;
@alxfv
alxfv / gist:5bfae63a98d428192ee1
Last active August 29, 2015 14:05
trait example
<?php
trait CreatedTrait
{
/**
* @var DateTime
*/
protected $created;
/**
@alxfv
alxfv / gist:b081080378f321fc9624
Created August 25, 2014 19:28
String reverse
<?php
for ($i = 0, $j = strlen($s) - 1; $i < strlen($s) / 2; $i++, $j--) {
$c = $s[$i];
$s[$i] = $s[$j];
$s[$j] = $c;
}
<?php
function solve($n) {
if ($n > 0) {
echo solve($n - 1);
}
return $n;
}
solve(10);
server {
listen 80;
root /home/faost/www/test;
index index.html;
server_name test;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
/*
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !!
Highlights arbitrary terms.
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
MIT license.
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>-->
<script src="http://www.km.ru/misc/jquery.js"></script>
<script>
@alxfv
alxfv / gist:6a6ddc54abc768e00253
Created June 16, 2014 11:32
setDefaultOptions
<?php
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'type' => 'new',
));