This file contains hidden or 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 wc_get_first_parent($prod_id) { | |
| $group_args = array( | |
| 'post_type' => 'product', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => '_children', | |
| 'value' => 'i:' . $prod_id . ';', | |
| 'compare' => 'LIKE', | |
| ) | |
| ), |
This file contains hidden or 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
| public static class IndexedEnumerable | |
| { | |
| public static IndexedEnumerable<T> AsIndexedEnumerable<T>(this IEnumerable<T> source) | |
| { | |
| return Create(source); | |
| } | |
| public static IndexedEnumerable<T> Create<T>(IEnumerable<T> source) | |
| { | |
| return new IndexedEnumerable<T>(source); |
This file contains hidden or 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
| fcs() { | |
| OUTPUT=$(dotnet format) | |
| if [ $? -eq 0 ]; then | |
| powershell -file $HOME/Toast.ps1 "Dotnet Format", "Completed successfully" | |
| else | |
| powershell -file $HOME/Toast.ps1 "Dotnet Format", "Failed $OUTPUT" | |
| fi | |
| } |
This file contains hidden or 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
| [user] | |
| email = jsimmons@jeremysimmons.net | |
| name = jeremy simmons | |
| [alias] | |
| # Get the current branch name (not so useful in itself, but used in other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" | |
| # Delete the remote version of the current branch |
This file contains hidden or 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
| HttpClient httpClient = new HttpClient(); | |
| MultipartFormDataContent form = new MultipartFormDataContent(); | |
| form.Add(new StringContent(username), "username"); | |
| form.Add(new StringContent(useremail), "email"); | |
| form.Add(new StringContent(password), "password"); | |
| form.Add(new ByteArrayContent(file_bytes, 0, file_bytes.Length), "profile_pic", "hello1.jpg"); | |
| HttpResponseMessage response = await httpClient.PostAsync("PostUrl", form); | |
| response.EnsureSuccessStatusCode(); |
This file contains hidden or 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
| git config --local core.hooksPath $PWD/.githooks |
This file contains hidden or 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
| ### Keybase proof | |
| I hereby claim: | |
| * I am jeremysimmons on github. | |
| * I am jeremysimmons (https://keybase.io/jeremysimmons) on keybase. | |
| * I have a public key ASDIP-c5HuHQmDj7RHXsgbpuzy-rz3dvocAQAqQ7XYMK2Ao | |
| To claim this, I am signing this object: |
This file contains hidden or 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
| # ----------------------------------------------------------------- | |
| # .gitignore for WordPress @salcode | |
| # ver 20180808 | |
| # | |
| # From the root of your project run | |
| # curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
| # to download this file | |
| # | |
| # By default all files are ignored. You'll need to whitelist | |
| # any mu-plugins, plugins, or themes you want to include in the repo. |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Dismiss Checkpoint Access Warning | |
| // @namespace checkpoint | |
| // @version 1 | |
| // @description automatically dismiss the checkpoint access pages so I don't have to. | |
| // @author Jeremy Simmons | |
| // @match *://10.2.1.4/* | |
| // @grant none | |
| // @run-at document-idle | |
| // ==/UserScript== |
This file contains hidden or 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
| // For example, in .NET if an exception is thrown/re-thrown from the catch block, then the finally block will not execute. | |
| try | |
| { | |
| try | |
| { | |
| Console.WriteLine("try"); | |
| throw new Exception("intentional"); | |
| Console.WriteLine("will not print"); |