Skip to content

Instantly share code, notes, and snippets.

View zilahir's full-sized avatar
🍺

Richard Zilahi zilahir

🍺
View GitHub Profile
@zilahir
zilahir / json.json
Created February 17, 2019 21:19
json
[
{
"url": "http://www.mfa.gov.hu/emb/helsinki/",
"title": "Magyar Nagykövetség, Helsinki",
"desc": ""
},
{
"url": "http://www.suomiunkari.fi/",
"title": "Suomi-Unkari Seura",
"desc": "Finn – Magyar baráti társaság"
@zilahir
zilahir / bitbucket-pipeline.yml
Last active January 3, 2019 22:19
bitbucket-pipeline
pipelines:
branches:
master:
- step:
image: node:8
name: run webpack
script:
- cd wp-content/themes/wp-demo/assets/src
- npm install -g webpack
- npm install -g webpack-cli
@zilahir
zilahir / change-db.sh
Created January 3, 2019 21:52
change-db
#!/bin/bash
#This script changes the database with the latest file in repo's !sql folder. This script is triggered by a manual step in bitbucket pipeline
cd !sqldump;
latest_sql_file=`ls -Art | tail -n 1`;
cd ..
#connect to devel database and
#1. drop the current database there
TABLES=$(mysql --host <host> -u <user> -p<pass> <db-name> -e 'show tables' | awk '{ print $1}' | grep -v '^Tables' );
@zilahir
zilahir / pre-commit.sh
Created January 3, 2019 21:41
pre-commit
#!/usr/bin/env bash
current_date=`date +%Y_%m_%d_%H_%M`;
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump
mkdir -p "$current_date";
mysqldump --net_buffer_length="83000" -u wp_user -pwp_password -h 0.0.0.0 -P 32770 --skip-extended-insert wordpress > /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date"/"$current_date".sql
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date";
echo "adding new sql file to repo"
cd /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/
git add /Users/richardzilahi/zilahir/tuts/wp/1/wordpress/!sqldump/"$current_date"/"$current_date".sql
@zilahir
zilahir / pre-push.sh
Created January 3, 2019 18:22
protect master branch on git
#!/bin/bash
protected_branch='master'
policy="\n\n[Policy] Never push code directly to the "$protected_branch" branch! (Prevented with pre-push hook.)\n\n"
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
push_command=$(ps -ocommand= -p $PPID)
@zilahir
zilahir / webpack.config.js
Last active December 30, 2018 22:07
webpack config
const path = require("path");
module.exports = {
resolve: {
alias: {
'node_modules': path.join(__dirname, 'node_modules'),
}
},
entry: {
"common" : "./js/site.js",
@zilahir
zilahir / pre-push.sh
Created November 10, 2018 23:18
pre-push lock master branch
#!/bin/bash
protected_branch='master'
policy="\n\n[Policy] Never push code directly to the "$protected_branch" branch! ("$protected_branch" is locked! )\n\n"
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
push_command=$(ps -ocommand= -p $PPID)
@zilahir
zilahir / wordpress.config
Created November 9, 2018 14:26
nginx config file for docker wordpress
server {
listen 80;
server_name 127.0.0.1;
root /var/www/html;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
@zilahir
zilahir / docker-compose.yml
Created November 9, 2018 14:26
docker compose for wordpress
version: '3.6'
services:
nginx:
image: nginx:latest
container_name: nginx
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx:/etc/nginx/conf.d
@zilahir
zilahir / firebase.json
Created May 22, 2018 09:39
firebase settings
{
"hosting": {
"public": "/",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [ {
"source": "/contact", "function": "addMessageToSlack"