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 | |
# Copyright 2017 Théo Chamley | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in the Software | |
# without restriction, including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
# to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the controller to call when that URI is requested. |
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
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
sudo swapon --show |
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
#Ensure to exit docker from taskbar first. | |
cd ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux /Applications/Docker.app/Contents/MacOS/qemu-img convert -O qcow2 Docker.qcow2 Docker2.qcow2 mv Docker2.qcow2 Docker.qcow2 |
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
The API is at https://www.ipify.org/ | |
The API endpoint is https://api.ipify.org?format=json | |
function httpGetAsync(theUrl, callback) | |
{ | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.onreadystatechange = function() { | |
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) | |
callback(xmlHttp.responseText); |
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
docker rm $(docker ps -qa --no-trunc --filter "status=exited") | |
Or to force... | |
docker rm -f $(docker ps -qa --no-trunc --filter "status=exited") |
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
#In this example 'phpfpm-demo' is the name of the image, you need to run this as a 'sh' script in the directory where the Dockerfile is located. | |
docker ps -a | awk '{ print $1,$2 }' | grep phpfpm-demo | awk '{print $1 }' | xargs -I {} docker rm {} | |
docker rmi phpfpm-demo | |
docker build -t phpfpm-demo . | |
docker run -p 9000:9000 phpfpm-demo |
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
SELECT | |
company.company_id, | |
address.address_id, | |
contact.contact_id, | |
company.company_code, | |
company.company_name, | |
address.address1, | |
address.address2, | |
address.locality, | |
address.town, |
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
SELECT | |
sd.compclass_id as 'Pricelist ID', | |
cc.short_desc as 'Pricelist', | |
UPPER(st.stock_code) as 'SKU' | |
FROM struc_discounts AS sd | |
LEFT JOIN stock as st | |
ON sd.stock_id = st.stock_id | |
LEFT JOIN company_class as cc |
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
Checkout | |
`git checkout --orphan latest_branch` | |
Add all the files | |
`git add -A` | |
Commit the changes | |
`git commit -am "commit message"` | |
Delete the branch |
NewerOlder