Skip to content

Instantly share code, notes, and snippets.

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

calvez calvez

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "kohadeps"
@calvez
calvez / 0_reuse_code.js
Created December 23, 2015 05:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@calvez
calvez / gist:053c6aa865f2c49cfbf7a20efad13edb
Created July 6, 2016 03:50 — forked from mattfarina/gist:751854
Make Drupal 7 search button an image button.
/**
* Implements hook_form_alter().
*
* Courtesy of JohnAlbin
*/
function THEMENAME_form_search_block_form_alter(&$form, &$form_state) {
$form['actions']['submit']['#type'] = 'image_button';
$form['actions']['submit']['#src'] = drupal_get_path('theme', 'THEMENAME') . '/images/button-search.png';
}
@calvez
calvez / convert id_rsa to pem
Created October 18, 2016 14:53 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
@calvez
calvez / LICENCE SUBLIME TEXT
Created November 27, 2016 18:14
Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@calvez
calvez / wp_update.sh
Created December 4, 2016 21:23 — forked from MiteshShah/wp_update.sh
Update Multiple WordPress
#!/bin/bash
# Define Variables
WEB_ROOT=/var/www
WEB_ROOT_PREFIX=htdocs
WEB_ROOT_GROUP=www-data
WP_UPDATE_LOGS=/var/log/setup/wp-update.log
# Capture Errors
function OwnError() {
@calvez
calvez / gist:a2aab955fb979e288b7c7fcb9f7faf80
Created January 6, 2017 16:35
Facebook Javascript SDK Demo
<!--
Facebook Javascript SDK Demo
Refs:
https://developers.facebook.com/docs/javascript/quickstart/v2.0
http://hayageek.com/facebook-javascript-sdk/
http://pt.slideshare.net/littleq0903/introduction-to-facebook-javascript-sdk-new
https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0
http://pivotallabs.com/working-with-asynchronously-loaded-javascript/
@calvez
calvez / gist:980195eeb07aea0cb85b5a5dc522e989
Created February 11, 2017 11:32 — forked from mikejolley/gist:6713608
WooCommerce Shipping Method Skeleton Plugin
<?php
/*
Plugin Name: Your Shipping plugin
Plugin URI: http://woothemes.com/woocommerce
Description: Your shipping method plugin
Version: 1.0.0
Author: WooThemes
Author URI: http://woothemes.com
*/
@calvez
calvez / fix-drupal-permissions.sh
Last active April 6, 2017 08:55
Drupal - Bash shell script to fix Drupal permissions
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis