Skip to content

Instantly share code, notes, and snippets.

View MyLittleTestRepository's full-sized avatar

MyLittleTestRepository

View GitHub Profile
@Jekis
Jekis / update-phpstorm.sh
Last active July 24, 2022 06:49 — forked from olivertappin/update-phpstorm.sh
Download and install the latest version of PhpStorm for Ubuntu. Create .desktop file and use custom vmoptions.
#!/bin/bash
#
# Based on https://gist.github.com/olivertappin/e5920e131db9a451c91aa6e2bc24dc40
#
INSTALL_DIR=/opt/phpstorm
if [ "$(whoami)" != "root" ]
then
@carcinocron
carcinocron / debugger pause beforeunload
Last active July 22, 2025 08:53
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@marvell
marvell / bitrix_iblock_properties.md
Created January 17, 2014 13:19
Bitrix: памятка по типам свойств инфоблока

Bitrix: памятка по типам свойств инфоблока

Для пользовательских типов свойств нужно указывать еще и USER_TYPE.

Привязка к элементам в виде списка:

PROPERTY_TYPE => 'E' 
USER_TYPE => 'EList' 

Дата/Время:

PROPERTY_TYPE => 'S' 
@fnhipster
fnhipster / gist:5460604
Created April 25, 2013 15:27
Mobile/Desktop htaccess redirect
# MOBILE REDIRECT
RewriteCond %{REQUEST_URI} !/mobile.*$
RewriteCond %{REQUEST_URI} !/hub.*$
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ /mobile [L,R=302]
# if a user is accessing a mobile page from desktop then show desktop version
RewriteCond %{HTTP_USER_AGENT} "!android|!blackberry|!iphone|!ipod|!iemobile|!opera mobile|!palmos|!webos|!googlebot-mobile" [NC]
RewriteRule ^mobile/(.*)$ / [L,R=302]
301 moved permanently (redirect):
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.example.com');
die();
?>
302 moved temporarily(redirect):
<?php
header('Location: http://www.example.com');