Skip to content

Instantly share code, notes, and snippets.

View nevergone's full-sized avatar

Kurucz István nevergone

View GitHub Profile
@nevergone
nevergone / gist:958608
Created May 6, 2011 08:25
Linux promt-om
export GIT_PS1_SHOWDIRTYSTATE=true
# colored prompt
USER=`whoami`
if [ $LOGNAME = $USER ] ; then
USERCOLOR=32 # green
else
USERCOLOR=33 # yellow
fi
if [ $USER = 'root' ] ; then
USERCOLOR=31 # red
location /foo/bar {
auth_basic "Auth name";
auth_basic_user_file /etc/phpmyadmin/htpasswd;
try_files $uri/ $uri/index.php;
}
location ~ ^/foo/bar(.+\.php)$ {
alias /usr/share/phpmyadmin$1;
fastcgi_pass unix:/var/run/php5-fpm/www-data.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$1;
@nevergone
nevergone / gist:3065812
Created July 7, 2012 10:41
PHP APC konfiguráció
extension = apc.so
apc.shm_segments = 1
apc.shm_size = 256
apc.optimization = 0
apc.num_files_hint = 2048
apc.ttl = 3600
apc.user_ttl = 3600
apc.enable_cli = 1
apc.max_file_size = 1M
apc.rfc1867 = 1
@nevergone
nevergone / gist:4271273
Created December 12, 2012 20:26
dátum-felismeréshez reguláris kifejezés
(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])
make_contrib:
projects[$project_name$][subdir] = "$directory$"
projects[$project_name$][version] = "$version$"
;projects[$project_name$][download][revision] = "$revision$"
;projects[$project_name$][download][branch] = "$branch$"
;projects[$project_name$][patch][] = "$patch_path$"
make_custom:
projects[$project_name$][type] = "$type$"
/**
* Form callback
*/
function ajax_disable_test_form($form, &$form_state) {
$form['select'] = array(
'#type' => 'select',
'#required' => FALSE,
'#title' => t('Change me!'),
'#empty_option' => t('- Select -'),
'#options' => drupal_map_assoc(range(1, 3)),
@nevergone
nevergone / D5-SA-CORE-2018-002.patch
Last active April 29, 2018 14:22
SA-CORE-2018-002 - Drupal 5 patch
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5b2e5ab..b2e00ab 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -911,6 +911,7 @@ function _drupal_bootstrap($phase) {
drupal_unset_globals();
// Initialize the configuration
conf_init();
+ _drupal_bootstrap_sanitize_request();
break;
@nevergone
nevergone / D5-SA-CORE-2018-004.patch
Last active April 29, 2018 14:25
D5-SA-CORE-2018-004.patch (SA-CORE-2018-002 fix included)
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5b2e5ab..3d93104 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -911,6 +911,7 @@ function _drupal_bootstrap($phase) {
drupal_unset_globals();
// Initialize the configuration
conf_init();
+ _drupal_bootstrap_sanitize_request();
break;
@nevergone
nevergone / bootstrap.inc
Last active April 29, 2018 14:25
D5-SA-CORE-2018-004 includes/bootstrap.inc (SA-CORE-2018-002 fix included)
<?php
/**
* @file
* Functions that need to be loaded on every Drupal request.
*/
/**
* Indicates that the item should never be removed unless explicitly told to
* using cache_clear_all() with a cache ID.
@nevergone
nevergone / vimeo-downloader.js
Last active November 22, 2021 10:23 — forked from mistic100/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
// or use ffmpeg: "ffmpeg -i video.mp4 -i audio.wav -c copy output.mkv"
const fs = require('fs');
const url = require('url');
const https = require('https');