This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global --add merge.tool kdiff3 | |
git config --global --add mergetool.kdiff3.path "absolute-path-to-the-kdiff-execution-file" | |
git config --global --add mergetool.kdiff3.trustExitCode false | |
git config --global --add diff.guitool kdiff3 | |
git config --global --add difftool.kdiff3.path "absolute-path-to-the-kdiff-execution-file" | |
git config --global --add difftool.kdiff3.trustExitCode false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use App; | |
use October\Rain\Support\ModuleServiceProvider; | |
class ServiceProvider extends ModuleServiceProvider | |
{ | |
/** | |
* Register the service provider. | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Cache; | |
use Cms\Classes\ComponentBase; | |
abstract class CachableComponentBase extends ComponentBase | |
{ | |
/** | |
* Build cache configuration which is an array: ['cachedKey' => 'The cache key value', 'cachedTimeInMinutes' => 'Cached time in minutes'] | |
* @return mixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TextUtil { | |
public static function sanitize($title) { | |
$replacement = '-'; | |
$map = array(); | |
$quotedReplacement = preg_quote($replacement, '/'); | |
$default = array( | |
'/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ|À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ|å/' => 'a', | |
'/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ|È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ|ë/' => 'e', | |
'/ì|í|ị|ỉ|ĩ|Ì|Í|Ị|Ỉ|Ĩ|î/' => 'i', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -r --merged | grep -v '\*\|master\|dev\|DTP-263' | sed 's/origin\///' | xargs -n 1 git push --delete origin | |
#The syntax to put branch to keep: \|branch-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name website-domain.com; | |
root /data/apps/excitingthing; | |
index index.html index.htm index.php; | |
charset utf-8; | |
set $skip_cache 0; | |
# POST requests and urls with a query string should always go to PHP | |
if ($request_method = POST) { | |
set $skip_cache 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_users SET user_pass = MD5('new_password') WHERE ID='id_of_the_user_to_reset_password' LIMIT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#It helps to add ClientAliveInterval of 60 mins into SSH config | |
sudo echo 'ClientAliveInterval 60' >> /etc/ssh/sshd_config | |
#Then, restart SSH | |
#Below is the command to restart ssh on Ubuntu based | |
sudo service ssh restart | |
#Other Linux distribution | |
sudo service sshd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Please enter the source repository you want to move" | |
read SOURCE_REPOS | |
echo "Please enter the target repsitory that you want to move the repos" | |
read TARGET_REPOS | |
git clone --bare $SOURCE_REPOS | |
SOURCE_GIT_META_DIR=$(basename $SOURCE_REPOS) | |
cd $SOURCE_GIT_META_DIR && git push --mirror $TARGET_REPOS && cd .. && rm -rf $SOURCE_GIT_META_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Analytic = (function(){ | |
var module = {}; | |
var trackEventOfElement = function(el) { | |
var category = el.attr('data-category'); | |
var action = el.attr('data-action'); | |
var label = el.attr('data-label'); | |
var value = el.attr('data-value'); | |
module.trackEvent(category, action, label, value); | |
}; | |
var trackSocialOfElement = function(el) { |