Skip to content

Instantly share code, notes, and snippets.

View irekasoft's full-sized avatar

iReka Soft irekasoft

View GitHub Profile
@irekasoft
irekasoft / gist:10009289
Created April 6, 2014 17:47
Setup customized tab bar for ios 7
- (void)setupTabBar
{
// Assign tab bar item with titles
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = tabBar.items[0];
UITabBarItem *tabBarItem2 = tabBar.items[1];
UITabBarItem *tabBarItem3 = tabBar.items[2];
Intent intent = new
Intent(getApplicationContext(),SecondActivity.class);
intent.putExtra("myKey",AnyValue);
startActivity(intent);
Now you can get the passed values by...
Bundle extras = intent.getExtras();
String tmp = extras.getString("myKey");
http://flags.redpixart.com/list/
@irekasoft
irekasoft / FirstViewController.h
Created March 5, 2016 16:47
Collection View with draggable cell. 5px padding each.
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate>{
CGSize cellSize;
}
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
{
"destination_addresses" : [
"Mid Valley Megamall, 75, Lingkaran Syed Putra, Mid Valley City, 58000 Kuala Lumpur, Wilayah Persekutuan Kuala Lumpur, Malaysia"
],
"origin_addresses" : [ "Unnamed Road, 26700 Muadzam Shah, Pahang, Malaysia" ],
"rows" : [
{
"elements" : [
{
"distance" : {
/**
* Remove the slug from published post permalinks. Only affect our custom post type, though.
*/
function gp_remove_cpt_slug( $post_link, $post, $leavename ) {
if ( 'race' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
isPresenting = true
return self
}
{
"Class Component": {
"prefix": "irp",
"body": [
"import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react'",
"import React from 'react'",
"",
"const ${1:$TM_FILENAME_BASE} = () => {",
" return (",
" <IonPage>",