Skip to content

Instantly share code, notes, and snippets.

View sobi3ch's full-sized avatar
🎯
Focusing

Piotr Sobieszczański sobi3ch

🎯
Focusing
View GitHub Profile
@sobi3ch
sobi3ch / load_jquery_from_console.js
Created September 11, 2013 11:28
Load jQuery from any browser console. Just copy&paste into your console.
javascript:if(!window.jQuery||confirm('Overwrite\x20current\x20version?\x20v'+jQuery.fn.jquery))(function(d,s){s=d.createElement('script');s.src='https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js';(d.head||d.documentElement).appendChild(s)})(document);
@sobi3ch
sobi3ch / build.xml
Last active December 27, 2015 01:59
Phing: Potential error in attribute 'options' in filesync task. Always adding 'v' (verbose) on the end of options line whatever you put in options. 'verbose' options can be turn but I think that's not a solution. Below target will produce following command: [filesync] /usr/bin/rsync -av --exclude=sites/default/settings.phpv "/var/www/drupal/drup…
<?xml version="1.0" encoding="UTF-8"?>
<project name="TCS intranet" default="build" basedir="." description="a demo project">
<property name="project.name" value="intranet.childrenssociety.org.uk" />
<property name="rsync.sourcedir" value="/var/www/drupal/drupal-7.x/" />
<property name="rsync.destinationdir" value="/var/www/drupal/jenkins-drupal7/live" />
<target name="update-code" >
<filesync
sourcedir="${rsync.sourcedir}"
destinationdir="${rsync.destinationdir}"
@sobi3ch
sobi3ch / admin-recreate.sh
Created November 13, 2013 10:49
Recreating [Admin] button in OpenAtrium due to bug https://drupal.org/comment/8166761
drush en -y admin_views contextual_tabs ctools ctools_custom_content fape pm_existing_pages page_manager stylizer views_content defaultconfig bartik block color comment field field_sql_storage field_ui file filter image list menu node number options path search shortcut system taxonomy text update user date_all_day date_api date date_ical date_popup_authored date_popup date_repeat date_repeat_field date_views apps features features_override feeds conditional_fields entityreference field_group geofield link multiupload_filefield_widget flag trash_flag fullcalendar_colors fullcalendar fullcalendar_legend fullcalendar_options caption_filter image_resize_filter wysiwyg_filter mailsystem mimemail file_entity media_internet media media_vimeo media_youtube message_digest message message_notify message_subscribe message_subscribe_ui oa_responsive_regions oa_variables oa_admin oa_appearance oa_buttons oa_config oa_contextual_tabs oa_core oa_dashboard oa_date oa_diff oa_discussion oa_events_import oa_events oa_favorite
@sobi3ch
sobi3ch / install-all-bootstrap-components.sh
Last active December 30, 2015 05:09
What to do to smoothly run 'grunt' command in source bootstrap project. Made on Ubuntu 13.10. Run from home dir.
#!/bin/bash
# install all necessary packages
sudo apt-get update && sudo apt-get install -y libfontconfig1 ruby1.9.1-dev git zip nodejs npm
# install jekyll
sudo gem install jekyll --no-ri --no-rdoc
# link /usr/bin/nodejs > /usr/bin/node; phantomeJS has some problem if command is not strict 'node'. DEbian/ubuntu normally has 'nodejs'
sudo ln -s /usr/bin/nodejs /usr/bin/node
LOCALHOST:~/vagrant/my_ubuntu $ VAGRANT_LOG=debug vagrant up > log.txt
INFO global: Vagrant version: 1.3.5
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/guests/gentoo/plugin.rb
INFO manager: Registered plugin: Gentoo guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/guests/openbsd/plugin.rb
INFO manager: Registered plugin: OpenBSD guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/guests/solaris11/plugin.rb
INFO manager: Registered plugin: Solaris 11 guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/guests/ubuntu/plugin.rb
INFO manager: Registered plugin: Ubuntu guest
@sobi3ch
sobi3ch / gist:7908803
Created December 11, 2013 11:27
Vagrantfile for Ubuntu apache2 www-data with write permission for group
config.vm.synced_folder "./www", "/vagrant", :mount_options => ["dmode=775","fmode=664"], group: "www-data"
@sobi3ch
sobi3ch / behat.yml
Created April 16, 2014 12:39
How integreate 'selectors' with Behat (regon_map is requreid to work with selectors)
default:
paths:
features: 'features'
extensions:
Behat\MinkExtension\Extension:
goutte: ~
selenium2: ~
base_url: https://production.server/
Drupal\DrupalExtension\Extension:
blackbox: ~
@sobi3ch
sobi3ch / login.sh
Created February 2, 2015 13:57
Login to Drupal via https
#!/bin/bash
# Obviously change name and pass values and example.com domain
curl --insecure \
--cookie ./cookie.txt \
--cookie-jar ./cookie.txt \
-e example.com \
-d "name=admin" \
-d "pass=admin" \
-d "form_id=user_login" \
https://example.com/user
@sobi3ch
sobi3ch / polon.php
Created March 27, 2015 11:49
Polish radiostations from linux CLI / Polskie radiostacje z linii poleceń
<?php
define('INDENT', ' ');
// Radio list
$radiostations = [
'trojka' => 'mms://stream.polskieradio.pl/program3_wma10',
'dwojka' => 'mms://stream.polskieradio.pl/program2_wma10',
'jedynka' => 'mms://stream.polskieradio.pl/program1_wma10',
'luz' => 'http://radioluz.pwr.wroc.pl/listen.pls',