Skip to content

Instantly share code, notes, and snippets.

View sbalci's full-sized avatar
πŸ”¬
πŸ”¬πŸ‘€πŸ“‘πŸ—ƒπŸ“ŠπŸ¨πŸ—„πŸ“‡πŸ“–βš—πŸ“πŸŽΆπŸ“ˆπŸ“‰πŸ“ƒπŸ–πŸ”¬πŸ”¬πŸ‹πŸ»β€β™‚πŸš΄πŸ»β€β™‚πŸš™πŸ‘¨β€πŸ’»πŸ€·β€β™‚πŸ“ΈπŸ“ΊπŸŽ›πŸ”­πŸ”¬πŸ’ŠπŸ”πŸ«πŸŒΈ

Serdar BalcΔ± sbalci

πŸ”¬
πŸ”¬πŸ‘€πŸ“‘πŸ—ƒπŸ“ŠπŸ¨πŸ—„πŸ“‡πŸ“–βš—πŸ“πŸŽΆπŸ“ˆπŸ“‰πŸ“ƒπŸ–πŸ”¬πŸ”¬πŸ‹πŸ»β€β™‚πŸš΄πŸ»β€β™‚πŸš™πŸ‘¨β€πŸ’»πŸ€·β€β™‚πŸ“ΈπŸ“ΊπŸŽ›πŸ”­πŸ”¬πŸ’ŠπŸ”πŸ«πŸŒΈ
View GitHub Profile
@sbalci
sbalci / change_pmpro_account_text.php
Created October 12, 2020 14:44 — forked from andrewlimaza/change_pmpro_account_text.php
change pmpro account text with gettext filter
<?php
//copy lines 5 onwards into your PMPro customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_my_pmpro_account_text', 20, 3 );
/**
* Change words for pmpro account page
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
@sbalci
sbalci / remove_billing_example.php
Created October 12, 2020 14:45 — forked from andrewlimaza/remove_billing_example.php
Remove 'Billing' from 'Billing Address' title in Paid Memberships Pro.
<?php
/**
* Copy the function below into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* This function uses the gettext filter which will change all text occurences of Billing Address to Address in Paid Memberships Pro.
*/
function change_text_billing_pmpro( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Billing Address' :
$translated_text = __( 'Address', 'paid-memberships-pro' );
break;
@sbalci
sbalci / citations_to_retracted_by_journal.csv
Created October 31, 2020 14:41 — forked from domenicrosati/citations_to_retracted_by_journal.csv
Journal Citations to Retracted Articles Post Retraction
Journal Total Citations Citations to Retracted Articles Post Retraction % of citations to retracted articles
plos one 12783331 2959 0.02%
scientific reports 6295134 1227 0.02%
oncology letters 802286 898 0.11%
journal of biological chemistry 10712422 866 0.01%
biomed research international 1789456 806 0.05%
oncotarget 1353740 791 0.06%
international journal of molecular sciences 2380553 766 0.03%
proceedings of the national academy of sciences 9984417 704 0.01%
molecular medicine reports 754664 646 0.09%
<?php
/**
* This recipe will redirect you to the levels page after registration
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_redirect_after_register( $user_id ){
@sbalci
sbalci / Subfolder to git repo.md
Created January 2, 2021 13:48 — forked from cruftlord/Subfolder to git repo.md
Convert subfolder into Git submodule
@sbalci
sbalci / Git: Empty branch.md
Created January 5, 2021 10:04 — forked from blattmann/Git: Empty branch.md
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@sbalci
sbalci / !Making Measurements in QuPath
Created January 25, 2021 05:24 — forked from Svidro/!Making Measurements in QuPath
Making Measurements in QuPath
Collections of scripts harvested mainly from Pete, but also picked up from the forums
TOC
Accessing dynamic measurements.groovy - Most annotation measurements are dynamically created when you click on the annotation, and
are not accessible through the standard getMeasurement function. This is a way around that.
Affine transformation.groovy - access more accurate measurements for the affine transformation used in the image alignment (m5/m6+)
Alignment of local cells.groovy - check neighborhood for similarly aligned cells
@sbalci
sbalci / repo-reset.md
Created January 31, 2021 16:14 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@sbalci
sbalci / QuPath_cells_to_areas.groovy
Created February 24, 2021 15:45 — forked from petebankhead/QuPath_cells_to_areas.groovy
QuPath script to calculate areas (e.g. of tumor) based upon classified cells only
/**
* QuPath script to calculate areas (e.g. of tumor) based upon classified cells only.
*
* It works by using a distance transform applied to binary images generated from the
* objects of each class, and then assigns each pixel to the closest object.
*
* Having done this, new annotations are generated for these regions.
*
* WARNINGS!
* - This will remove *all* previous annotations & replace them with new annotations
<?php
/*
Add bcc for checkout emails
*/
function my_pmpro_email_headers_admin_emails($headers, $email)
{
//bcc checkout emails
if($email->template == "membership_expiring" || $email->template == "membership_expired")
{
//add bcc