Skip to content

Instantly share code, notes, and snippets.

View nmurzin's full-sized avatar
🖥️
Hello world

Nikita Murzin nmurzin

🖥️
Hello world
View GitHub Profile
@nmurzin
nmurzin / Makefile
Created February 19, 2021 13:36 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@nmurzin
nmurzin / oneFunctionUpdater.js
Created September 17, 2020 22:54 — forked from Harshmakadia/oneFunctionUpdater.js
One function to update multiple input state value
import React from "react";
function Form() {
const [state, setState] = React.useState({
firstName: "",
lastName: ""
})
// same function can be used to update multiple values in the state
const handleChange = (evt) => {
interface WelcomeProps {
name: string;
}
const Welcome: React.FC<WelcomeProps> = (props) => <h1>Hello, {props.name}</h1>;
@nmurzin
nmurzin / pre-commit
Created April 10, 2018 12:45 — forked from fesor/pre-commit
php-cs-fixer pre-commit hook
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="bin/php-cs-fixer"
PHP_CS_CONFIG=".php_cs"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES;
git add $CHANGED_FILES;
@nmurzin
nmurzin / index.html
Created August 26, 2016 15:12
How to transfer jquery to bottom of the page
<head>
<script>
// Fallback code for the jQuery inline scripts on pages:
if (window.jQuery === undefined) {
window.jQueryReadyHandlers = [];
window.$ = window.jQuery = function (callback) {
window.jQueryReadyHandlers.push(callback);
return window.$;
};
@nmurzin
nmurzin / brainfuck.php
Created July 15, 2015 12:05
Brainfuck
<?php
class Foo {
public $deepest = 10;
public function __toString()
{
return 'deep';
}
}