Skip to content

Instantly share code, notes, and snippets.

View nsorosac's full-sized avatar

Nicolas Sorosac nsorosac

  • Saint-Etienne, France
View GitHub Profile
@nash-ye
nash-ye / command-loop-wp-cli-search-replace.bash.sh
Last active July 18, 2023 12:12
A Linux command to loop through CSV file records and do WP search-replace.
while IFS=, read orig new; do wp --skip-themes --skip-plugins search-replace "$orig" "$new" wp_posts --include-columns=post_content --verbose; done < example.csv
@ABarailler
ABarailler / nobomb.php
Created March 21, 2017 09:59
Pour les fichiers corrompu
<?php
// Tell me the root folder path.
// You can also try this one
// $HOME = $_SERVER["DOCUMENT_ROOT"];
// Or this
// dirname(__FILE__)
$HOME = dirname(__FILE__);
// Is this a Windows host ? If it is, change this line to $WIN = 1;
$WIN = 0;
@bpongy
bpongy / variables.scss
Last active February 9, 2017 11:10
Project guideline
$bold: 700;
$light: 300;
$brand-secondary: #CD5334;
// taille de la gouttière
$grid-gutter-width: 20px;
// taille du container desktop
$container-large-desktop: 1144px + $grid-gutter-width;
// arrondi des boutons, champs, etc
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 22, 2024 03:44
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@lengarvey
lengarvey / assets_location_nginx.conf
Created September 25, 2012 01:14
Access control allow origin header for nginx
location /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
@lavoiesl
lavoiesl / wordpress-change-url.php
Last active December 8, 2022 12:09
PHP script to replace site url in Wordpress database dump, even with WPML
#!/usr/bin/env php
<?php
/**
* PHP script to replace site url in Wordpress database dump, even with WPML
* @link https://gist.github.com/lavoiesl/2227920
*/
if (!empty($argv[1]) && $argv[1] == 'update') {
$file = file_get_contents('https://gist.github.com/lavoiesl/2227920/raw/wordpress-change-url.php');
if ($file === false) {
@tdd
tdd / gitconfig.ini
Last active April 17, 2024 10:04
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);