Trickey – A teeny Keyboard for Your Favorite Shortcuts

Does too many keys on your full size keyboard make you go crazy while playing games or doing a copy and paste? Then Trickey is FOR you! A natty little hardware which allows you to configure whatever keys you fancy. 
 
All that you need to do is to plug in Trickey’s replaceable keys in the sockets provided on the board and use the companion key writing software to tailor the keys according to your requisites. 
IMG_5777.PNG Trickey – A teeny Keyboard for Your Favorite Shortcuts Trickey – A teeny Keyboard for Your Favorite Shortcuts IMG 5777
 
Trickey is a (working) prototype at this point. “Trickey is a normal HID USB keyboard. So Trickey works on any systems which supports HID USB keyboards. And we are planning to make the writer software on Windows and Mac OS. Already we have developed the prototype software on Windows” says one of Trickey’s Creator

Google’s ARC Welder

Google’s new ARC (App Runtime for Chrome) Welder software lets users to run Android mobile apps through the Chrome browser on any operating system.

You can now bring your much loved Android apps to a PC or Mac by simply installing Chrome browser and the ARC Welder. The ARC Welder program will request access to the corresponding APK file of the app which the user wish to run.


ARC Welder is now accessible through the Chrome Web Store. The application is in Beta phase and can only run one app at a time. However, Google will make all the Android apps accessible across multiple platforms eventually.Google’s Arc Welder runs on Android 4.4 but not on Android 5.0 Lollipop is a letdown.

Facebook Pay – On the way??

Last month Facebook brought in ‘payments’ to Messenger, which lets you use the chat application to make friend-to-friend payments. A single tap on $ button lets you transfer money to a friend without leaving the chat thread. 


And the recent announcement from Facebook’s F8 conference is really an aspiring plan. It will let users to connect with the merchant over Messenger and make Retailers feel like your friends. You could get receipts, request changes to an order, or receive customer support in a single message thread rather than a log of mail threads. Facebook may well let you log in and process the transaction for purchases on third-party sites and apps. And yes, buying things would turn as easy as liking!


WordPress: Function add css or js to head

In some case you might want to add elements to theme header. We are using child theme and didn’t want to disrupt parent wordpress theme. This wordpress snippet should do the job

 

[code]

function theme_styles()
{
wp_enqueue_style(‘linaro-css’, ‘/app/css/app.css’);
wp_enqueue_script(‘linaro-js’, ‘/app/js/app.js’);

}
add_action(‘wp_enqueue_scripts’, ‘theme_styles’);

[/code]

jQuery Twitter follow all

You can use the below jQuery snippet with google chrome to follow all users on certain twitter page or twitter list. Please note this script will follow all users who you are not following and will unfollow users you are following. (Once I have fix for this I will post it on our twitter & facebook page).For now this should help you.

  1. Open google chrome
  2. Go to twitter list of page where you can see list of users and follow button
  3. Right click and select “inspect element”
  4. Click on “Show Drawer” button on right hand side, beside the setting button in google chrome inspect element
  5. Past the below code

Please note it will unfollow users who you are already following

[code]

$(‘.not-following button.follow-button’).click()

[/code]

 

Once I find a fix for how to not unfollow following users, I will post on our facebook page

dreamweaver find and replace content inside div

Dreamweaver : Replacing content inside div or other tags

Dreamweavers has powerful search and replace tool. You might have div’s with same class or id but the content inside might be different.  Using this code you can replace all the content inside particul div.

Select search and replace in dreamweaver: edit > find and replace

Make sure “User regular expression” is selected

Original

<div id="table-text">
   <p>Title 1</p>
</div>
<div id="table-text">
   <p>Title 2</p>
</div>
<div id="table-text">
   <p>Title 3</p>
</div>

 

In find and replace past the below code

Find:

<div id="table-text">([\s\S]*?)</div>

Replace:

<div id="table-text"></div>

Click replace all

Result

<div id="table-text">
</div>
<div id="table-text">
</div>
<div id="table-text">
</div>

 

You can see it remove everything inside <div id=”table-text”>.

 

Here:

<div id=”table-text”> = Unique div you are trying to replace

([\s\S]*?) = Selects everything inside that div

 

Finding content between certain code

eg 1:

  • <a href=”https://www.google.com/url?q=http://www.web.com/137786&sa=D&usg=ALhdy2987B6W7bupfJfSkOXz1iGWMq-FcA” target=”_blank”>
  • <a href=”https://www.google.com/url?q=http://www.web.com/member/137787&sa=D&usg=ALhdy28tpngN_1Cx7avCvVq-h-QxAdo5og” target=”_blank”>
  • <a href=”https://www.google.com/url?q=https://www.web.com/cd6bl05p29lr38idfn7l4dh6n34&sa=D&usg=ALhdy28FtPMP3boFcPH-h5QljJ_qycCH6g” target=”_blank”>
  • <a href=”https://www.google.com/url?q=https://www.web.com/c6cbh0rr2488ls6bkogvi4ggcic&sa=D&usg=ALhdy28geBKzd8BKP2pnRI5jqWb3TKBp0g” target=”_blank”>

Lets say, in the link you want to remove everything after &sa=

Use the following regular expression to remove information between

&sa[^>]*target=
  • &sa = looks for text containing &sa
  • [^>]* = selectest everything after it
  • target= stops selection when target=

eg 2:

Remove every thing inside <input> tag

  • Find: <input [^>]*>
  • Replace: <input>

Learning source: http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt1.html & http://www.adobe.com/devnet/dreamweaver/articles/regular_expressions_pt2.html

 

 

 

WordPress: Show content from specific page in theme

This wordpress snippet should allow you to show specific page in wordpress theme. In the following example we are show the page if its home page

 

[code]

<?php if(is_front_page()) { ?>
<div>
<?php
$id=6137;
$post = get_post($id);
$content = apply_filters(‘the_content’, $post->post_content);
echo $content;
?>
</div>
<?php } ?>
[/code]

 

is_front_page() = check if its home page

$id = Page. You can go to wordpress admin, click on the page you want the content from. On the admin panel you will see page id. eg: http://website.com/wp-admin/post.php?post=6137&action=edit

apply_filters(‘the_content’, $post->post_content);  = gets the content from the page

echo $content;  = shows the content

 

If you want the content to show on all page. Use this snippet

[code]
<div>
<?php
$id=6137;
$post = get_post($id);
$content = apply_filters(‘the_content’, $post->post_content);
echo $content;
?>
</div>
[/code]

Follow us on Facebook / Twitter / Google+ and myself for more tips

WordPress Remove Custom post types from non admin users

[code]
function wp_remove_posttype_non_admin() {
if( !current_user_can( ‘administrator’ ) ):
remove_menu_page( ‘edit.php?post_type=your_post_type’ );
endif;
}
add_action( ‘admin_menu’, ‘wp_remove_posttype_non_admin’ );
[/code]

your_post_type should be the name of your actual post type.

Remove Standard menu

[code]

remove_menu_page(‘edit.php’); // Posts
remove_menu_page(‘upload.php’); // Media
remove_menu_page(‘link-manager.php’); // Links
remove_menu_page(‘edit-comments.php’); // Comments
remove_menu_page(‘edit.php?post_type=page’); // Pages
remove_menu_page(‘plugins.php’); // Plugins
remove_menu_page(‘themes.php’); // Appearance
remove_menu_page(‘users.php’); // Users
remove_menu_page(‘tools.php’); // Tools
remove_menu_page(‘options-general.php’); // Settings

[/code]

Remove Plugin menu

For plugins, it seems you only need the page= query var. The other thing to note is the priority, which is the third argument to the admin_menu add_action. It has to be set low enough (the higher the number, the lower the priority) so that plugins have already added themselves to the menu.

[code]
function wp_remove_posttype_non_admin() {
if( !current_user_can( ‘administrator’ ) ):
remove_menu_page(‘cart66_admin’);
endif;
}
add_action( ‘admin_menu’, ‘wp_remove_posttype_non_admin’, 9999 );
[/code]

Remove metabox

[code]
remove_meta_box(‘tagsdiv-post_tag’, ‘post’, ‘normal’);
remove_meta_box(‘categorydiv’, ‘post’, ‘normal’);
remove_meta_box(‘postimagediv’, ‘post’, ‘normal’);
remove_meta_box(‘authordiv’, ‘post’, ‘normal’);
remove_meta_box(‘postexcerpt’, ‘post’, ‘normal’);
remove_meta_box(‘trackbacksdiv’, ‘post’, ‘normal’);
remove_meta_box(‘commentstatusdiv’, ‘post’, ‘normal’);
remove_meta_box(‘postcustom’, ‘post’, ‘normal’);
remove_meta_box(‘commentstatusdiv’, ‘post’, ‘normal’);
remove_meta_box(‘commentsdiv’, ‘post’, ‘normal’);
remove_meta_box(‘revisionsdiv’, ‘post’, ‘normal’);
remove_meta_box(‘authordiv’, ‘post’, ‘normal’);
remove_meta_box(‘slugdiv’, ‘post’, ‘normal’);
[/code]

Via Milo on stackexchange & Paul
http://bit.ly/wpremovecustomemenu & http://bit.ly/removemetaboxwp

wordpress

Modify WP Role via Function.php

You can add or remove wp roles in function.php

 

[code]
$edit_contributor = get_role(‘author’);
$edit_contributor->add_cap(‘edit_pages’);
$edit_contributor->remove_cap(‘publish_pages’);
[/code]

 

get_role

Set with users role you want to modify

add_cap

Add new privileges to that user

remove_cap

Remove privileges to that user

 

Full list of privileges can be viewed on wordpress codex

Follow us on Facebook & Google+

Via WP Snippet : http://bit.ly/wpauthorpage

home