Skip to content

Instantly share code, notes, and snippets.

View thamas's full-sized avatar

Tamás Hajas thamas

View GitHub Profile
@thamas
thamas / Get back your Drupal install-profile
Last active August 29, 2015 14:05
Sometimes Drupal forgots about your install-profile. To fix:
drush vset install_profile 'profile-name'
@thamas
thamas / css-class-drupal-wysiwyg-cke.md
Last active August 29, 2015 13:57
Make custom CSS classes work with Drupal WYSIWYG 7.x-2.2 and CKEditor 4.3.3

I use it to set img floats. To make it work

  1. be sure to define at least one inline element class (when you defined your image float classes), for examle Emphasize=span.emph
  2. add a "cache-buster" to the end of the path of you css file: /sites/all/themes/mytheme/css/style.css?v1 (the "chache-buster" is the "?v1" at the end of the path. More info: http://chipcullen.com/how-to-apply-classes-ckeditor-4-in-drupal-7/)
@thamas
thamas / get-own-ip
Last active December 28, 2015 05:19
Get own IP address
curl -l http://echoip.net; echo
@thamas
thamas / sublime-regexp-remove-newlines.md
Last active December 19, 2015 08:39
Sublime regexp remove newlines

Using Sublime Text's Replace function with regex

Remove newlines from paragraph:

Changes this:

"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment.

@thamas
thamas / sublime-regexp-add-month-name-to-date.md
Last active December 19, 2015 08:39
sublime regexp add month name to date

Using Sublime Text's Replace function with regex

changes this:
"1997.01.01.";

to this:
"1997.01.03.";"Január";

Find What:

@thamas
thamas / compass-text-replacement-span.scss
Last active December 19, 2015 03:29
compass scss text-replacement span
//see http://compass-style.org/reference/compass/typography/text/replacement
//compass 0.12.2
@import "compass/typography/text/replacement"
span.logo {
@include replace-text-with-dimensions("logo.png");
display: inline-block;
position: relative;
top: 4px;
@thamas
thamas / drupal_rules_access_alias_only.txt
Last active December 19, 2015 00:48
Drupal 7, Rules export. Use to redirect anonymous user to frontpage when she tries to access content using node/[nid] path. So content will be available only on its path alias.
{ "rules_access_w_alias_only" : {
"LABEL" : "Acces content with alias only",
"PLUGIN" : "reaction rule",
"TAGS" : [ "access" ],
"REQUIRES" : [ "rules" ],
"ON" : [ "node_view" ],
"IF" : [
{ "user_has_role" : {
"account" : [ "site:current-user" ],
"roles" : { "value" : { "1" : "1" } }
@thamas
thamas / drupal-profiler-builder-drush.md
Last active December 18, 2015 21:59
Create new Drupal install profile with Profiler Builder module and drush

drush distro mynewprofile_name --untar

//
// Default font dir is <css_dir>/fonts Set fonts_dir in config.rb
// if you want to change. See:
// http://compass-style.org/help/tutorials/configuration-reference/
//
// http://compass-style.org/reference/compass/css3/font_face/
// "Order of the includes matters, and it is: normal, bold, italic, bold+italic."
//
// See also: http://mikefowler.me/thoughts/compass-font-face-syntax/;
//
@thamas
thamas / compass-set-box-sizing-border-box.scss
Created May 19, 2013 15:16
Compass: set box-sizing to border-box for all html5 block level element
article,
aside,
blockquote,
body,
br,
button,
canvas,
caption,
col,
colgroup,