Skip to content

Instantly share code, notes, and snippets.

View snapeuh's full-sized avatar
🏆
TBDITW

Romain Etchegoyhen snapeuh

🏆
TBDITW
View GitHub Profile
@snapeuh
snapeuh / autoexec.cfg
Last active August 11, 2023 22:00
CS:GO autoexec
// Bind
bind "f1" "buy m4a1; buy ak47"
bind "f2" "buy famas; buy galilar"
bind "f3" "buy mac10; buy mp9"
bind "f4" "buy awp"
bind "f5" "buy hegrenade"
bind "f6" "buy flashbang"
bind "f7" "buy smokegrenade"
bind "f8" "buy incgrenade; buy molotov"
bind "f10" "buy vest"
@snapeuh
snapeuh / gulpfile.js
Created February 13, 2020 08:35
Example gulfile for WP + Bedrock
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require('browser-sync').create();
gulp.task('sass', function () {
return gulp.src('web/app/themes/**/css/*.scss', { base: './' })
@snapeuh
snapeuh / remove_apps_miui.cmd
Created November 22, 2019 10:29
Remove some Google apps and MIUI apps on my Xiaomi 9T phone
@echo off
set /p Y=Enter adb path:
cd /d %Y%
adb devices
pause
adb shell pm uninstall --user 0 com.android.chrome
adb shell pm uninstall --user 0 com.google.android.apps.tachyon
adb shell pm uninstall --user 0 com.google.android.music
adb shell pm uninstall --user 0 com.google.android.talk
adb shell pm uninstall --user 0 com.google.android.videos
@snapeuh
snapeuh / install-plugins.sh
Last active February 27, 2018 06:38
Install multiple plugins with WP-CLI. Install : `chmod +x install-plugins.sh`. Use : `./plugin-installs.sh plugin-name-1 plugin-name-2 ...`.
#!/bin/bash
PLUGINS="$@"
for PLUGIN in $PLUGINS; do
wp plugin install $PLUGIN --activate
done
@snapeuh
snapeuh / wp-config.php
Created October 11, 2016 14:00
Use WordPress with a dynamic domain
<?php
define('SP_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', SP_REQUEST_URL);
define('WP_HOME', SP_REQUEST_URL);
@snapeuh
snapeuh / functions.php
Last active September 28, 2016 19:34
Create a WordPress user from code
<?php
function add_admin_acct(){
$login = 'utilisateur';
$passw = 'motdepasse';
$email = 'email@email.com';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $login, $passw, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
@snapeuh
snapeuh / add-favicon.php
Created January 26, 2016 13:35
WordPress mu-plugin to update favicon
<?php
/*
Plugin Name: Add Favicon
Description: Add Favicon
Author: Romain Etchegoyhen
*/
add_action('wp_head', 'add_favicon');
function add_favicon() {
$icon_url = get_template_directory_uri() . '/images/favicon.ico';