π¨βπ»
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
| // The function uses reflection to convert Proto struct to interface and vice versa. | |
| // Although reflection is CPU intensive, the code is optimised to short circuit at most of the places to convert in most optimal way | |
| package converter | |
| import ( | |
| "reflect" | |
| "strconv" | |
| "google.golang.org/protobuf/types/known/structpb" | |
| ) |
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 enum Singleton { | |
| INSTANCE; | |
| // Add your methods here | |
| public void getString() { | |
| System.out.println("Hi"); | |
| } | |
| // Invoke singleton from main method present in any class | |
| public static void main(String[] args) { |
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
| <PayPalScriptProvider options={initialOptions}> | |
| <PayPalButtons | |
| style={{ layout: "horizontal" }} | |
| createOrder={async (data, actions) => { | |
| try { | |
| const orderId = await generateOrder(Id, currency); | |
| setOrderId(orderId); | |
| return orderId; | |
| } catch { | |
| Toastr.error("Error Creating Paypal Order"); |
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
| <script type="text/javascript"> | |
| (function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "); | |
| for(h=0;h<i.length;h++)g(a,i[h]); |
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
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| $(document).on('click', '[data-tracker]', function(e) { | |
| var trackData = $(this).data('tracker'); | |
| if (!trackData) { return; } | |
| var tagData = ParseTagData.tagData(trackData); | |
| if (!tagData.action || !tagData.label ) { return; } |
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
| <script type="text/javascript"> | |
| mixpanel.track('page viewed', { | |
| 'page name' : document.title, | |
| 'url' : window.location.pathname | |
| });</script> |
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
| import json | |
| from requests import Request, Session | |
| from requests_oauthlib import OAuth1 | |
| # <consumer_key>:<token_key>:<token_secret> | |
| # xxxxxxxxxxxxxx:yyyyyyyyyyy:zzzzzzzzzzzzzz | |
| # Replace the below key and secret string with actual one | |
| auth1 = OAuth1(u'consumer_key', u'', |
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
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <sys/wait.h> | |
| int main(){ | |
| int pid; | |
| char cmd[128]; | |
| while(1){ | |
| printf("prompt>"); |