Create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
<?php | |
use Jenssegers\Mongodb\Eloquent\Model as Eloquent; | |
use LaunchCMS\Utils\SerializeUtil; | |
abstract class LaunchEloquentModel extends Eloquent implements \Serializable | |
{ | |
protected $connection = 'mongodb'; | |
protected $array_fields = []; | |
public function serialize() | |
{ |
Create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
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) { |
#!/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 |
#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 |
UPDATE wp_users SET user_pass = MD5('new_password') WHERE ID='id_of_the_user_to_reset_password' LIMIT 1; |
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; |
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 |
<?php | |
class TextUtil { | |
public static function sanitize($title) { | |
$replacement = '-'; | |
$map = array(); | |
$quotedReplacement = preg_quote($replacement, '/'); | |
$default = array( | |
'/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ|À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ|å/' => 'a', | |
'/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ|È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ|ë/' => 'e', | |
'/ì|í|ị|ỉ|ĩ|Ì|Í|Ị|Ỉ|Ĩ|î/' => 'i', |