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
    
  
  
    
  | global $woocommerce; | |
| //Get url of cart page | |
| $cart_url = WC_Cart::get_cart_url(); //one way to do it | |
| $checkout_url = WC_Cart::get_checkout_url(); | |
| //Get total value of cart | |
| $cart_total = $woocommerce->cart->get_cart_total(); //other way to do it | |
| //Get number of cart items | 
  
    
      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 void checkPerms(){ | |
| if (ContextCompat.checkSelfPermission(MainActivity.this, | |
| Manifest.permission.READ_EXTERNAL_STORAGE) | |
| != PackageManager.PERMISSION_GRANTED) { | |
| // Should we show an explanation? | |
| if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, | |
| Manifest.permission.READ_EXTERNAL_STORAGE)) { | |
| // Show an explanation to the user *asynchronously* -- don't block | 
  
    
      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
    
  
  
    
  | package in.rishirajpurohit.android.fileaccess; | |
| import android.Manifest; | |
| import android.content.ContentResolver; | |
| import android.content.pm.PackageManager; | |
| import android.database.Cursor; | |
| import android.graphics.Color; | |
| import android.net.Uri; | |
| import android.os.Environment; | |
| import android.provider.MediaStore; | 
  
    
      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
    
  
  
    
  | <html> | |
| <head> | |
| <title>GIT Home</title> | |
| </head> | |
| <body > | |
| <h1>Welcome to GIT</h1> | |
| <br/> | |
| <hr/> | |
| <br/> | 
  
    
      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
    
  
  
    
  | <!-- http://therunapp.co/wp-content/uploads/2018/06/simple-website-download-sample-html-page-template-login-free.jpg --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sample Page</title> | |
| </head> | |
| <body> | |
| <!-- Header --> | |
| <div style="background-color:#12ac90;height: 200px;"> | 
  
    
      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
    
  
  
    
  | # Which directory have composer.json and composer.lock | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--path', help='Relative directory that contains the composer files') | |
| cdir = parser.parse_args().path | |
| # Reads composer.json for constraints | |
| reqPack = {} | |
| with open(cdir +'/composer.json') as json_file: | |
| data = json.loads(json.dumps(json.load(json_file))) | |
| for package in data['require']: | 
  
    
      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
    
  
  
    
  | # Read the latest version available from packagist | |
| finalRes = [] | |
| for package in reqPack: | |
| finalPackageResult = { | |
| 'name': package | |
| } | |
| # Try to get info from packagist (works with or w/o repo) | |
| url = 'https://repo.packagist.org/packages/' + package + '.json' | |
| jsonMetaRes = requests.get(url) | 
  
    
      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 package in reqPack: | |
| finalPackageResult = { | |
| 'name': package | |
| } | |
| # Find current installed version | |
| try: | |
| cur_ver = semver.Version.coerce(inPack[package]) | |
| except ValueError: | |
| if re.search("^v[0-9].*$", inPack[package]): | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python3 | |
| import argparse | |
| from pathlib import Path | |
| # Define available arguments | |
| parser = argparse.ArgumentParser( | |
| description="Create a new .loc site for local development. It will create a new folder inside ~/Sites, add a virtualhost and an entry in /etc/hosts") | |
| parser.add_argument('siteName', metavar='Site Name', | |
| help='Name of the site to create') | |
| parser.add_argument('--debug', help='display debug information') | 
OlderNewer