Skip to content

Instantly share code, notes, and snippets.

View neonxp's full-sized avatar
🤖
Code to live, live to code

Alex neonxp

🤖
Code to live, live to code
  • Kazan, Russian Federation
View GitHub Profile
@neonxp
neonxp / gist:4134350
Created November 23, 2012 07:17
Google token generator
<?
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@neonxp
neonxp / gv
Last active July 13, 2022 14:11
Simple version manager for golang
#!/bin/sh
if [ ! -f $HOME/go/bin/go$1 ]; then
echo "Version $1 not found, trying to install"
go install golang.org/dl/go$1\@latest
go$1 download
fi
rm $HOME/go/bin/go || true
echo "Linking go to version $1"
ln -s $HOME/go/bin/go$1 $HOME/go/bin/go
@neonxp
neonxp / gist:1498882
Created December 19, 2011 21:09
ASCII
_ _ _
|\ ||_ / \|\ |\/|_)
| \||_ \_/| \|/\|
M"""""""`YM MM""""""""`M MMP"""""YMM M"""""""`YM M""MMMM""M MM"""""""`YM
M mmmm. M MM mmmmmmmM M' .mmm. `M M mmmm. M M `MM' M MM mmmmm M
M MMMMM M M` MMMM M MMMMM M M MMMMM M MM. .MM M' .M
M MMMMM M MM MMMMMMMM M MMMMM M M MMMMM M M .mm. M MM MMMMMMMM
M MMMMM M MM MMMMMMMM M. `MMM' .M M MMMMM M M MMMM M MM MMMMMMMM
@neonxp
neonxp / Я - сова 🦉
Last active May 22, 2021 00:28
Я - сова :)
🌞 Утро 12 коммитов ██░░░░░░░░░░░░░░░░░░░ 9.8%
🌆 День 38 коммитов ██████▍░░░░░░░░░░░░░░ 30.9%
🌃 Вечер 34 коммитов █████▊░░░░░░░░░░░░░░░ 27.6%
🌙 Ночь 39 коммитов ██████▋░░░░░░░░░░░░░░ 31.7%
@neonxp
neonxp / Dockerfile
Last active March 16, 2019 01:40
Docker for PHP 5.3 project
FROM ubuntu:12.04
MAINTAINER Alexander Kiryukhin <alexander@kiryukhin.su>
RUN apt-get update
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl curl lynx-cur php5-xdebug php5-memcached memcached wget
RUN a2enmod php5
rep(/\n/gi, "<br />");
rep(/\[\[button\s+([a-z0-9\-_]+)(?:\s+(.+?))?\]\]/i,"<a href='#'>WDButton::$1</a>");
rep(/\*\*(.*?)\*\*/gi,"<span style=\"font-weight: bold;\">$1</span>");
rep(/--(.*?)--/gi,"<span style=\"text-decoration: line-through;\">$1</span>");
rep(/\{\{(.*?)\}\}/gi,"<pre>$1</pre>");
rep(/\^\^(.*?)\^\^/gi,"<sup>$1</sup>");
rep(/,,(.*?),,/gi,"<sub>$1</sub>");
rep(/\[\[span(.*)?\]\](.*?)\[\[\/span\]\]/mi,"<span $1>$2</span>");
rep(/\[\[table(.*)?\]\](.*?)\[\[\/table\]\]/mi,"<table$1>$2</table>");
rep(/\[\[row(.*)?\]\](.*?)\[\[\/row\]\]/mi,"<tr$1>$2</tr>");
@neonxp
neonxp / keymap.cson
Created February 3, 2016 12:34
IntelliJ keybindings for Atom
'.editor':
'ctrl-shift-n': 'fuzzy-finder:toggle-file-finder'
'ctrl-1': 'tree-view:toggle'
'ctrl-shift-up': 'editor:move-line-up'
'ctrl-shift-down':'editor:move-line-down'
'ctrl-shift-w':'pane:close-other-items'
'ctrl-shift-a': 'command-palette:toggle'
'ctrl-l': 'go-to-line:toggle'
'ctrl-alt-ctrl-up': 'pane:split-right'
'ctrl-alt-ctrl-down': 'pane:split-down'
USER=$(whoami)
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/public; ls *.res | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steam/cached/; ls *.res | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/friends; ls *.res | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/graphics; ls *.tga | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/servers; ls *.tga | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; don
@neonxp
neonxp / FormErrorsSerializer.php
Last active September 28, 2017 10:12 — forked from Graceas/FormErrorsSerializer.php
Symfony 2 Form Error Serializer. May be used for AJAX form validation. Allows tree and flat array styles for errors.
class FormErrorsSerializer {
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_')
{
$errors = array();
$errors['global'] = array();
$errors['fields'] = array();
foreach ($form->getErrors() as $error) {
$errors['global'][] = $error->getMessage();
@neonxp
neonxp / jsconfig.json
Last active July 4, 2017 12:48
jsconfig for React
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"jsx": "react",
"alwaysStrict": true
},
"exclude": [
"node_modules"