Skip to content

Instantly share code, notes, and snippets.

@patgod85
patgod85 / build.sh
Last active December 4, 2020 06:50
Завершение бекграундных тасок
#!/usr/bin/env sh
# Нам нужны собранные и доступные по http вендорные файлы фрагмента
yarn serve-static &
yarn serve-hat &
# Теперь можно стартануть сборку компоновщика
{ rimraf dist/composer/* && webpack -c src/client/composer/webpack.config.js; } &
# Ждём завершения последнего процесса в бекграунде
wait $!
# Теперь можно остановить серверы, запущенные в бекграунде в начале
@patgod85
patgod85 / Component.js
Last active May 18, 2016 08:22
Splash Screen
import React from 'react';
import splashActions from "actions/splashActions";
import SplashScreen from "../common/SplashScreen";
export default React.createClass({
handleClick(){
splashActions.show('splash1');
name: Squeezed case layout
description: Changes style of Case page. Makes it move inline
author: Victor
version: 1.0.0.4
js:
$(document).ready(function() {
var $emailBody = $('.emailBody');
if($emailBody.length > 0){
@echo off
setlocal EnableDelayedExpansion
:: You have to implement BatHelper.exe that will return you day of the week
for /F "delims=" %%a in ('BatHelper.exe dow') do set DayOfWeek=%%a
mkdir \\server\backups\GIT\%DayOfWeek%
for %%a in (timesheet, timesheet2) do (

Мысли по организации файлов локализации нашего проекта с ReactJs

Цель

Словать токенов для нашего веб приложения, который будет использоваться ReactIntl

Пожелания

import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@patgod85
patgod85 / serializationProblem.php
Created March 3, 2014 09:54
What if I want to serialize only Product with all properties. And I don't want to add Groups into Order's model.
<?php
require_once __DIR__ . '/../../../app/Autoload.php';
use JMS\Serializer\Annotation as Serializer;
/**
* @Serializer\ExclusionPolicy("all")
*/
class Order
@patgod85
patgod85 / bash-prompt-update.sh
Last active December 20, 2015 20:39
Color bash prompt and add git info if current folder in repository
#PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$
#GIT_BRANCH="git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'"
#$GIT_BRANCH
function getBranch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function getTags {
@patgod85
patgod85 / config.rb
Created August 2, 2013 04:31
Compass config It makes possible to use shortcut in PhpStorm
path_to_ruby_bin = 'C:\Ruby200-x64\bin\compass.bat'
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = ""
sass_dir = ""
# You can select your preferred output style here (can be overridden via the command line):
@patgod85
patgod85 / autocomplete_0003.js
Created February 25, 2013 07:26
My autocomplete
var rracarray, rrac_lastpart;
var rr_autocomplete = function(e, rracself, rraclimit, ajax_script_name, ajax_param_name){
var isArray = function(obj){return(typeof(obj.length)=="undefined")?false:true;}
var alertClient = function(http_request) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var tmp = eval(http_request.responseText);
if(isArray(tmp))rracarray=tmp;