Skip to content

Instantly share code, notes, and snippets.

git commit --amend --author "Stephen Way <way.stephen@gmail.com>" --no-edit && \
git rebase --continue
...
git push origin master --force
@blackjack99p
blackjack99p / user.js
Created March 7, 2018 09:00 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@blackjack99p
blackjack99p / ajax_download_by_form.js
Last active August 30, 2018 06:45
ajax download by form
export function downloadExport(apiUrl, idList) {
const form = document.createElement("form");
form.method = "POST";
form.action = apiUrl;
form.style.display = "none";
form.target = "_blank";
for (let i = 0, len = idList.length; i < len; i++) {
const ele = document.createElement("input");
ele.name = "params[selected_ids][]";
@blackjack99p
blackjack99p / wordpress-remove-seo-columns.php
Created June 28, 2016 05:04 — forked from chuckreynolds/wordpress-remove-seo-columns.php
remove WordPress SEO columns from admin post tables
<?php
function rkv_remove_columns( $columns ) {
// remove the Yoast SEO columns
unset( $columns['wpseo-score'] );
unset( $columns['wpseo-title'] );
unset( $columns['wpseo-metadesc'] );
unset( $columns['wpseo-focuskw'] );
@blackjack99p
blackjack99p / OpenWithSublimeText3.bat
Created April 28, 2016 02:46 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@blackjack99p
blackjack99p / gist:fe007ce3851efa3fb41c
Created October 29, 2015 07:01 — forked from opi/gist:5335785
Drupal 7 : Add translation programmatically
<?php
$report = array(
'skips'=>0,
'updates'=>0,
'deletes'=>0,
'additions'=>0
); // ??
$source = "Sometime drupal sucks";
$translation = "Drupal C DLA BALLE";