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
| /* | |
| * CredentialUI.cs - Windows Credential UI Helper | |
| * | |
| * License: Public Domain | |
| * | |
| */ | |
| using System; | |
| using System.ComponentModel; | |
| using System.Runtime.InteropServices; | |
| using System.Security; |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using WebMatrix.WebData; | |
| using System.Web.Routing; | |
| namespace Mvc4WithAuthentication.Auth | |
| { |
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
| myapp.menuHome.buttonResources_postRender = function (element, contentItem) { | |
| $(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ResourcesLarge.png', { height:170, width:170}); | |
| }; | |
| myapp.menuHome.buttonDesigns_postRender = function (element, contentItem) { | |
| $(element).spOverlay(contentItem, 'Content/Images/TouchIcons/DesignsLarge.png'); | |
| }; | |
| myapp.menuHome.buttonProjects_postRender = function (element, contentItem) { | |
| $(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ProjectsLarge.png'); |
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 android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
| private int previousTotal = 0; // The total number of items in the dataset after the last load | |
| private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
| private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
| int firstVisibleItem, visibleItemCount, totalItemCount; |
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
| <?php | |
| //* Remove breadcrumbs | |
| remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); | |
| //* Force full width content | |
| add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
| //* Remove entry meta in entry header | |
| remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); |
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
| //* Register Home Slider widget area | |
| genesis_register_sidebar( array( | |
| 'id' => 'home-slider', | |
| 'name' => __( 'Home Slider', 'mpp' ), | |
| 'description' => __( 'This is the home slider widget area.', 'mpp' ), | |
| ) ); | |
| //* Add custom Slider + Header wrapper's opening div tag | |
| add_action( 'genesis_before_header', 'sk_home_opening_div' ); | |
| function sk_home_opening_div() { |
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
| /** | |
| * Custom Scroll listener for RecyclerView. | |
| * Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
| */ | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = "EndlessScrollListener"; | |
| private int previousTotal = 0; // The total number of items in the dataset after the last load | |
| private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
| private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. |
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
| /** | |
| * Template Redirect | |
| * Use page_beaver.php for all static Pages. | |
| */ | |
| add_filter( 'template_include', 'custom_page_template', 99 ); | |
| function custom_page_template( $template ) { | |
| if ( is_singular( 'page' ) ) { | |
| $new_template = locate_template( array( 'page_beaver.php' ) ); | |
| if ( '' != $new_template ) { |
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
| // JS array equivalents to C# LINQ methods - by Dan B. | |
| // First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
| // Here's a simple array of "person" objects | |
| var people = [ | |
| { name: "John", age: 20 }, | |
| { name: "Mary", age: 35 }, | |
| { name: "Arthur", age: 78 }, | |
| { name: "Mike", age: 27 }, |
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 void printPermissions(Context context) { | |
| PackageInfo android; | |
| try { | |
| android = context.getPackageManager().getPackageInfo("android", PackageManager.GET_PERMISSIONS); | |
| } catch (PackageManager.NameNotFoundException e) { | |
| e.printStackTrace(); | |
| return; | |
| } | |
| PermissionInfo[] permissions = android.permissions; |
OlderNewer