Skip to content

Instantly share code, notes, and snippets.

View m4tlch's full-sized avatar
🏠
Working from home

Paul Nike m4tlch

🏠
Working from home
  • Ukraine
View GitHub Profile
@m4tlch
m4tlch / drupal-colorbox.js
Created March 31, 2016 10:31
JS: Responsive ColorBox Drupal
/*
==========================================================================
$Colorbox Responsive
* How to make colorbox responsive
* see @ https://www.drupal.org/node/2154099
==========================================================================
*/
(function ($, Drupal, window, document, undefined) {
//Configure colorbox call back to resize with custom dimensions
$alter = array(
'max_length' => 60,
'ellipsis' => TRUE,
'word_boundary' => FALSE,
'html' => FALSE,
);
$message = views_trim_text($alter, $message);
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
@m4tlch
m4tlch / find_bug.php
Created May 24, 2016 10:37
How find where bug in PHP
<?php
$e = new \Exception;
var_dump($e->getTraceAsString());
function mymodule_user_login_credentials($username, $password)
{
if($uid = user_authenticate($username, $password))
{
user_login_submit(array(), array('uid' => $uid));
return true;
}
else
{
return false;
@m4tlch
m4tlch / visor-archivos-online.md
Created June 7, 2016 07:19 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="bira"
# Uncomment the following line to use case-sensitive completion.
<?php
/***************************************************************************\
| Sypex Dumper version 2.0.11 |
| (c) 2003-2011 zapimir zapimir@zapimir.net http://sypex.net/ |
| (c) 2005-2011 BINOVATOR info@sypex.net |
|---------------------------------------------------------------------------|
| created: 2003.09.02 19:07 modified: 2013.08.27 06:27 |
|---------------------------------------------------------------------------|
| Sypex Dumper is released under the terms of the BSD license |
write to /etc/httpd/conf/extra
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
Require all granted
AllowOverride All
</Directory>
@m4tlch
m4tlch / 00.howto_install_phantomjs.md
Created December 9, 2016 11:01 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev