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
:root { | |
--flex-gap: 1rem; /* Variable for gap */ | |
} | |
.flexbox { | |
display: flex; | |
flex-wrap: wrap; | |
gap: var(--flex-gap); | |
justify-content: center; | |
padding: var(--flex-gap); /* We use padding to give space between the edge of the flexbox and flex items */ |
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 | |
function convert_yapb_images_to_post_thumbnail () { | |
require_once ABSPATH . 'wp-admin/includes/image.php'; | |
global $wpdb; | |
$imagefileList = array(); | |
$imageRows = $wpdb->get_results( | |
'SELECT id,post_id,uri FROM ' . YAPB_TABLE_NAME . ' WHERE processed<>1 ORDER BY id' | |
); | |
//$len=count($imageRows) |
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 flexdestroy(selector) { | |
var $els = $(selector); | |
$els.each(function() { | |
var $el = $(this); | |
var $elClean = $el.clone(); | |
$elClean.find('.flex-viewport').children().unwrap(); | |
$elClean |
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 | |
$salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36); | |
echo "Salt used: " . $salt ."<br/>"; | |
echo "<br/>"; | |
$password = 'new_password'; | |
$salted = $password.'{'.$salt.'}'; |
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
brew uninstall --ignore-dependencies openssl | |
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb > openssl.rb | |
brew install ./openssl.rb |
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 (!username_exists('username')) { | |
$user_id = wp_create_user( 'username', 'password', 'email@email'); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); | |
print_r($user); | |
} |
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
tell application "Finder" | |
set selectedFiles to selection as alias list | |
set containingFolder to container of item 1 of selectedFiles | |
set {year:yr, month:mn, day:dy} to creation date of item 1 of selectedFiles | |
set convertedDate to (yr & "-" & (text -2 thru -1 of ("00" & ((mn) as integer))) & "-" & (text -2 thru -1 of ("00" & ((dy) as integer)))) as string | |
set theFolder to (make new folder at containingFolder with properties {name:convertedDate}) | |
repeat with i from 1 to count of selectedFiles | |
set thisItem to item i of selectedFiles | |
move thisItem to (theFolder) | |
end repeat |
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
data:[^}]+}, |
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
import { remote } from 'electron' | |
remote.globalShortcut.register('CommandOrControl+Shift+K', () => { | |
remote.BrowserWindow.getFocusedWindow().webContents.openDevTools() | |
}) | |
window.addEventListener('beforeunload', () => { | |
remote.globalShortcut.unregisterAll() | |
}) |
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 logEverywhere(s) { | |
console.log({s}) | |
if (Window && Window.webContents) { | |
Window.webContents.executeJavaScript(`console.log("${s.toString()}")`) | |
} | |
} |
NewerOlder