This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirection of port 80 to port 443 | |
<virtualhost *:80> | |
ServerName redmine.domain.com | |
KeepAlive Off | |
RewriteEngine On | |
#RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$ | |
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DISPLAY=:0.0 | |
DROPBOXPYPATH=/usr/bin/dropbox | |
XCLIP=/usr/bin/xclip | |
FILENAME=`date +shot-%Y-%m-%d-%H%M%S.png` | |
FULLPATH=$HOME/Dropbox/Public/Screenshots/$FILENAME | |
import -window root $FULLPATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before Script | |
before_script: | |
- composer self-update | |
- composer install --prefer-dist > /dev/null | |
- cp .env.example .env | |
- php artisan key:generate | |
- php artisan migrate:refresh | |
# Services | |
services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "airbnb", | |
"plugins": [ | |
"react" | |
], | |
"env": { | |
"es6": true | |
}, | |
"parserOptions": { | |
"ecmaVersion": 6, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SERVER_NAME=localhost \ | |
SERVER_PORT=80 \ | |
XDEBUG_CONFIG="PHPSTORM" \ | |
php -dxdebug.remote_host=`ip r | grep default | awk '/default/{print $3}'` \ | |
$@ | |
#Usage in the docker: | |
#c_xdebug.sh script.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "=============================================" | |
echo "== Telegram Script Installer ==" | |
echo "== ==" | |
echo "== for www.LinuxRussia.com ==" | |
echo "=============================================" | |
echo "Downloading necesary files..." | |
cd /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTMLElement.prototype.changeValueDetection = function(){ | |
var element=this; | |
var oldVal=element.value; | |
var GUID = function (){var S4 = function () {return(Math.floor(Math.random() * 0x10000).toString(16));};return (S4() + S4() + "-" +S4() + "-" +S4() + "-" +S4() + "-" +S4() + S4() + S4());}; | |
var uiq="GUID-"+GUID(); | |
if(window.changeValueDetectionEvents==undefined)window.changeValueDetectionEvents=new Event('changeValueDetection'); | |
element.setAttribute("data-uiq",uiq); | |
window[uiq]=setInterval(function(){ | |
if(element.value!=oldVal){ | |
oldVal=element.value;element.setAttribute("value",oldVal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#models.py | |
class Task(models.Model): | |
title = models.CharField(max_length=255) | |
description = models.TextField() | |
def __unicode__(self): | |
return self.title | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import unicodedata | |
import chardet | |
def replace_some_unicode_chars(frac_str): | |
try: | |
if isinstance(frac_str, str): | |
frac_str = frac_str.replace("⁄", "/") | |
frac_str = frac_str.replace("×", "x") |