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
| soheil@hungryheidi tmp $ git clone https://github.com/kpwn/tpwn.git | |
| Cloning into 'tpwn'... | |
| remote: Counting objects: 16, done. | |
| remote: Compressing objects: 100% (11/11), done. | |
| remote: Total 16 (delta 3), reused 16 (delta 3), pack-reused 0 | |
| Unpacking objects: 100% (16/16), done. | |
| Checking connectivity... done. | |
| soheil@hungryheidi tmp $ whoami | |
| soheil | |
| soheil@hungryheidi tmp $ cd tpwn/ |
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
| var yolo = React.createClass({ | |
| _renderContentWithNavigation(component, title, rightButtonTitle) { | |
| return ( | |
| <Navigator | |
| style={styles.yoloContainer} | |
| renderScene={this.renderScene} | |
| initialRoute={{ | |
| title: 'YOLO', | |
| component: component, |
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
| 'use strict'; | |
| var React = require('react-native'); | |
| var { | |
| AppRegistry, | |
| Image, | |
| ListView, | |
| TouchableHighlight, | |
| NavigatorIOS, | |
| Text, |
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
| this.intervalID = this.setInterval(function(){ | |
| require('NativeModules').Native.statusBarSize(); | |
| }, 700) | |
| var subscription = require('RCTDeviceEventEmitter').addListener( | |
| 'statusBarSize', | |
| (size) => { | |
| this.setState({statusBarHeight: size.height}) | |
| } | |
| ); |
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
| - (void)statusBarSize | |
| { | |
| RCT_EXPORT(); | |
| CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame]; | |
| [self.bridge.eventDispatcher sendDeviceEventWithName:@"statusBarSize" | |
| body:@{@"width": [NSString stringWithFormat:@"%f",statusBarFrame.size.width], | |
| @"height": [NSString stringWithFormat:@"%f",statusBarFrame.size.height]}]; | |
| } |
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
| var yolo = React.createClass({ | |
| getInitialState: function() { | |
| return { | |
| selectedTab: 1, | |
| notifCount: 0, | |
| presses: 0, | |
| } | |
| }, | |
| _renderContentWithNavigation: function(component, rightButtonTitle) { |
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
| this.watchID = navigator.geolocation.watchPosition((lastPosition) => { | |
| var native = require('NativeModules').Native; | |
| native.locationFromLatitude(lastPosition.coords.latitude, lastPosition.coords.longitude) | |
| }); | |
| var subscription = require('RCTDeviceEventEmitter').addListener( | |
| 'LocationInfo', | |
| (location) => console.log(location.cityName) | |
| ); |
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
| // | |
| // native.m | |
| // yolo | |
| // | |
| // Created by Soheil Yasrebi on 4/1/15. | |
| // Copyright (c) 2015 Facebook. All rights reserved. | |
| // | |
| #import "RCTBridge.h" | |
| #import "RCTBridgeModule.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
| class Player | |
| def play_turn(warrior) | |
| @health = 0 if warrior.feel.empty? && @health == -1 | |
| shootableEnemy = false | |
| @pivoted = false | |
| warrior.look.each do |space| | |
| shootableEnemy |= space.enemy? | |
| end | |
| if !warrior.feel.enemy? && warrior.look.last.enemy? |
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
| sudo mv /Applications/iTunes.app/Contents/MacOS/iTunes /Applications/iTunes.app/Contents/MacOS/iTunesX | |
| sudo touch iTunes | |
| sudo chmod 777 iTunes | |
| sudo echo "open /Applications/Rdio.app" > /Applications/iTunes.app/Contents/MacOS/iTunes |
NewerOlder