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
# overwrite master with contents of feature branch (feature > master) | |
git checkout feature # source name | |
git merge -s ours master # target name | |
git checkout master # target name | |
git merge feature # source name |
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
Windows Registry Editor Version 5.00 | |
; Windows terminal | |
[-HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal] | |
[-HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal] | |
[-HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal] |
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 | |
add_shortcode( 'user_company_link', 'yanco_user_company_link' ); | |
function yanco_user_company_link() { | |
if( ! is_user_logged_in() ) { | |
return; | |
} | |
$html = ''; |
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
function Child({ onClick }) { | |
return <button onClick={onClick} type="button">Child Button</button>; | |
} | |
export default function Parent() { | |
const onClick = () => { | |
console.log('I\'m in the parent, but the child was clicked'); | |
}; | |
return ( |
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
<!--[if mso]> | |
<center> | |
<table><tr><td width="580"> | |
<![endif]--> | |
<div style="max-width:580px; margin:0 auto;"> | |
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p> | |
</div> | |
<!--[if mso]> |
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 | |
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40 | |
class DumpHTTPRequestToFile { | |
public function execute($targetFile) { | |
$data = sprintf( | |
"%s %s %s\n\nHTTP headers:\n", | |
$_SERVER['REQUEST_METHOD'], |
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 | |
/** Inserts a new node after a given reference node. Basically it is the complement to the DOM specification's | |
* insertBefore() function. | |
* @param \DOMNode $newNode The node to be inserted. | |
* @param \DOMNode $referenceNode The reference node after which the new node should be inserted. | |
* @return \DOMNode The node that was inserted. | |
*/ | |
function insertAfter(\DOMNode $newNode, \DOMNode $referenceNode) | |
{ | |
if($referenceNode->nextSibling === null) { |
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 | |
global $wpdb; | |
// Start Transaction | |
$wpdb->query( "START TRANSACTION" ); | |
// Do some expensive/related queries here | |
//$wpdb->query("DELETE FROM table WHERE form_id = '1' "); | |
//$wpdb->query("DELETE FROM data WHERE form_id = '1' "); | |
// set $error variable value in error handling after $wpdb modifications |
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
function index_progress_bar(title) { | |
var w = new Window("palette", title, undefined); | |
w.orientation = "column"; | |
var text_group = w.add("group"); | |
text_group.orientation = "column"; | |
var file_name = text_group.add("statictext", [0,0,350,20], "calculating.."); | |
var remain = text_group.add("statictext", [0,0,350,20], "Remain: .."); | |
text_group.alignChildren = "left"; | |
var progressbar = w.add("progressbar", undefined, 0, 100); | |
progressbar.preferredSize = [350,20]; |
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
var doc = app.activeDocument; | |
if(doc.saved == true) | |
{ | |
extract(2); | |
} | |
else | |
{ | |
alert("Save you file."); | |
} |
NewerOlder