Skip to content

Instantly share code, notes, and snippets.

View neonxp's full-sized avatar
🤖
moved to https://gitrepo.ru/

Alex neonxp

🤖
moved to https://gitrepo.ru/
View GitHub Profile
@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 / Я - сова 🦉
Last active May 22, 2021 00:28
Я - сова :)
🌞 Утро 12 коммитов ██░░░░░░░░░░░░░░░░░░░ 9.8%
🌆 День 38 коммитов ██████▍░░░░░░░░░░░░░░ 30.9%
🌃 Вечер 34 коммитов █████▊░░░░░░░░░░░░░░░ 27.6%
🌙 Ночь 39 коммитов ██████▋░░░░░░░░░░░░░░ 31.7%
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>");
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();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.button {
background-color: #eaeaea;
border: 1px solid #e7e7e7;
@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"
@neonxp
neonxp / get_icon_color.js
Last active February 27, 2017 09:05
Определение доминирующего цвета в иконке
function magic(image) {
var imgWidth = 18;
var imgHeight = 18;
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
// Draw white Rect to avoid problems with favicon opacity
ctx.fillStyle = 'rgb(255, 255, 255)';
ctx.fillRect(0, 0, imgWidth, imgHeight);
ctx.drawImage(image, 0, 0, imgWidth, imgHeight);
try {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.button {
display: inline-block;
background-color: #286aa8;

Keybase proof

I hereby claim:

  • I am neonxp on github.
  • I am neonxp (https://keybase.io/neonxp) on keybase.
  • I have a public key ASCs9o3_OMUqOB8FSPRRC1Vji0BPn0F4FfBTzc6muXyZkgo

To claim this, I am signing this object: