Skip to content

Instantly share code, notes, and snippets.

View emskaplann's full-sized avatar
👻

Emirhan Kaplan emskaplann

👻
View GitHub Profile
<% if current_user %>
<%= form_with model: @like, url: create_like_path, class: "float-right", remote: true do |f| %>
<%= f.hidden_field :user_id, value: session[:user_id] %>
<%= f.hidden_field :post_id, value: post.id %>
<% if User.find(session[:user_id]).liked(post) %>
<a class="limg<%=post.id%>" data-method="delete" data-remote="true" value="<%=post.id%>" href=<%=destroy_like_path(User.find(session[:user_id]).liked_post(post))%>><img class="limg<%=post.id%>" src="images/liked.png"></a>
<% else %>
<%= f.submit "", :type => :image, :src => "images/upvote2.png", :class => "limg#{post.id} float-right" %>
<% end %>
<h6 class="like-class<%=post.id%> float-right" style="vertical-align: bottom;"> <%= post.likes.count %> <span class="pl-3 float-right"></span></h6>
<%= form_with model: @like, url: create_like_path, class: "float-right", remote: true do |f| %>
<%= f.hidden_field :user_id, value: session[:user_id] %>
<%= f.hidden_field :post_id, value: post.id %>
<%= f.submit "", :type => :image, :src => "images/upvote2.png", :class => "limg#{post.id} float-right" %>
<% end %>
@emskaplann
emskaplann / Doesn't Work
Created November 28, 2019 21:30
style-props
input: {
position: 'absolute',
top: 30, // or 35 or 40
width: '92%',
height: 30,
fontSize: 25,
fontWeight: 'bold',
color: '#000000',
borderWidth: 1,
borderColor: '#000000',
input: {
position: 'absolute',
top: 29, // or 10 or 20
width: '92%',
height: 30,
fontSize: 25,
fontWeight: 'bold',
color: '#000000',
borderWidth: 1,
borderColor: '#000000',
@emskaplann
emskaplann / TextInputComp
Created November 28, 2019 21:33
TextInput
<View style={styles.inputContainer}>
<TextInput
style={styles.input}
onChangeText={(text) => this.setState({input: text.toLowerCase()})}
value={this.state.input}
/>
<TouchableHighlight style={styles.sendButton} onPress={()=> this.handleSubmit()}>
<View>
<Icon name="send" color="#fff" size={30}/>
</View>
** BUILD FAILED **
Xcode's output:
In file included from /Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/UIView+Toast.m:26:
/Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/UIView+Toast.h:328:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
@param sharedStyle
~~~~~~~~~~~~~~~~~^
/Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/UIView+Toast.h:343:25: warning: empty paragraph passed to '@param' command [-Wdocumentation]
@param allowTapToDismiss
~~~~~~~~~~~~~~~~~~~~~~~^
** BUILD FAILED **
Xcode's output:
warning: Stale file '/Users/emskaplann/HumaBreath/huma/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/protobuf.framework' is located outside of the allowed root paths.
In file included from /Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/FluttertoastPlugin.m:2:
/Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/UIView+Toast.h:328:19: warning: empty paragraph passed to '@param' command [-Wdocumentation]
@param sharedStyle
~~~~~~~~~~~~~~~~~^
/Users/emskaplann/flutter-main-folder/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-4.0.1/ios/Classes/UIView+Toast.h:343:25: warning: empty paragraph passed to '@param' command [-Wdocumentation]
@param allowTapToDismiss
@emskaplann
emskaplann / gist:977b967a620a5786eecb71b9d85387a5
Last active December 7, 2020 17:27
Emirhan Kaplan Resume

Emirhan Kaplan

[email protected] | (929)-405-8405 | New York City, NY

LinkedIn | GitHub | Medium

Full-Stack Web Developer

Software Developer with experience in object-oriented programming; developing and debugging while quickly learning and mastering new technologies that help maintain clean codebases. Has a passion for coding since sixth

@emskaplann
emskaplann / decodeWaysSolution.js
Last active September 29, 2020 15:43
My own solution for a popular Recursion Problem which is named as Decode Ways.
// This is a popular question asked on interviews. The optimum solution is achieved by using recursion. Because it's kind of building a binary tree with possible moves.
// **DECODE WAYS**
// PROBLEM DESCRIPTION:
// A message containing letters from A-Z is being encoded to numbers using the following mapping:
// 'A' -> 1
// 'B' -> 2
// ...
// 'Z' -> 26
// Given a non-empty string containing only digits, determine the total number of ways to decode it.