Skip to content

Instantly share code, notes, and snippets.

View psyao's full-sized avatar

Steve Aguet psyao

  • Marvelous Digital
  • Switzerland
View GitHub Profile
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
@psyao
psyao / zsh.md
Created May 7, 2017 19:44 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@psyao
psyao / clean.sql
Created April 12, 2017 10:23
Clean WP database after install
--
-- Constraints for table `wp_commentmeta`
--
ALTER TABLE `wp_commentmeta`
ADD CONSTRAINT `comment_id` FOREIGN KEY (`comment_id`) REFERENCES `wp_comments` (`comment_ID`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `wp_comments`
--
ALTER TABLE `wp_comments`
@psyao
psyao / laravel.js
Created October 21, 2015 09:05 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@psyao
psyao / after.sh
Last active March 14, 2018 21:29
Extra provisioning for Laravel Homestead
#!/bin/sh
if [ ! -f /usr/local/extra_homestead_software_installed ]; then
echo 'Installing some extra software'
# Set the timezone
sudo timedatectl set-timezone Europe/Zurich
# Install french language pack
sudo apt-get install language-pack-fr -y
@psyao
psyao / dbbackup.sh
Last active January 5, 2016 14:38
Dump vagrant databases
#!/bin/sh
# 0 9,16 * * * /home/vagrant/backups/dbbackup.sh >/dev/null
DATE=`date +%Y%m%d%H%M%S`
USER=homestead
PASSWORD=secret
echo "Changing directory..."
cd "/home/vagrant/backups/db/"
@psyao
psyao / .gitignore
Last active August 29, 2015 14:19 — forked from salcode/.gitignore
WordPress .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20150227
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@psyao
psyao / index.html
Created September 17, 2014 10:07
CSS position
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>CSS - Positionnement</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div id="page">
@psyao
psyao / deploy.cfg
Last active December 30, 2015 15:19
#Config file for deployment
documentroot=/Users/steve/Desktop/bash-scripts/test/remote/domain.com
giturl=ssh://user@domain.com/var/www/example.com
remotename=production
localpath=/Users/steve/Desktop/bash-scripts/test/local
user=steve
group=staff
@psyao
psyao / Vagrantfile
Last active February 18, 2022 18:53
Vagrant config file and provisioning script
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Box to build off of.
config.vm.box = "precise32"