Skip to content

Instantly share code, notes, and snippets.

View MemberStack-Custom-Code.js
var Webflow = Webflow || [];
Webflow.push(function() {
MemberStack.onReady.then(function(member) {
// handle the link click yourself
function triggerClick(event) {
event.preventDefault();
window.location.assign("https://website.com?id=" + member.id);
}
@ChrisDrit
ChrisDrit / gist:51813f2a4e78a1791764b76e5b8f0964
Created Oct 23, 2020
NoCodeQuest Editable Forms Snippet
View gist:51813f2a4e78a1791764b76e5b8f0964
<input type="hidden" name="Member Id" ms-data="id">
<input type="hidden" name="Comment Id" value=''>
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
$('#Name').val('');
$('#Comment').val('');
});
</script>
@ChrisDrit
ChrisDrit / gist:b631493912ddadbdb34ddd7ea8e1b062
Last active Feb 28, 2020
[Code] Webflow on form submit redirect page.
View gist:b631493912ddadbdb34ddd7ea8e1b062
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
$(document).on('submit', 'form', function() {
setTimeout(function() { location.reload(true); }, 3000);
});
});
</script>
@ChrisDrit
ChrisDrit / all_files.rake
Created Jun 11, 2019
Ruby Rake Task Methods
View all_files.rake
# -----------
# In reference to:
# http://www.albertoalmagro.com/ruby-methods-defined-in-rake-tasks/
# -----------
# Rakefile
# Load tasks
Dir.glob('*.rake').each do |path|
load path
end
@ChrisDrit
ChrisDrit / count.rb
Last active Dec 7, 2018
Example code
View count.rb
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
#
# ~= Coding Challenge =~
#
# The following coding challenge was presented to me:
#
# Write some code, that will flatten an array of arbitrarily nested
# arrays of integers into a flat array of integers.
# e.g. [[1,2,[3]],4] -> [1,2,3,4].
#
@ChrisDrit
ChrisDrit / Citrusbyte.rb
Created Jul 12, 2017
Citrusbyte Code Example from Chris Dritsas
View Citrusbyte.rb
# ----------------------
# Chris Dritsas
# Code Example
# ----------------------
# return flattened array
def squash(data=[])
# validate
raise "argument must be a non-empty array" if data.empty? or !data.is_a? Array
View gist:4981756
<h3>Collect Name of&nbsp;Restaurant, Phone Number and Address from URL provided.</h3>
<div class="highlight-box">
<ul>
<li>For this &quot;HIT url&quot; below, enter the Name of the Restaurant,&nbsp;the Phone Number, and the Address</li>
</ul>
<ul>
<li>Example - Name of Restaurant:&nbsp;<b><i>Guerilla Cafe</i></b></li>
<li>Example - Phone Number:&nbsp;<b><i>(510) 845-2233</i></b></li>
<li>Example - Address:&nbsp;<b><i>1620 Shattuck Ave, Berkeley, CA 94709</i></b></li>
<li>Exmaple above can be found at this url (<u>this is only an example url and <b>NOT</b> the &quot;HIT url&quot; - do <b>NOT</b> collect data from this example url</u>):&nbsp;http://bit.ly/UR3Oki</li>
View ruby-1.9-tips.rb
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@ChrisDrit
ChrisDrit / gist:724665
Created Dec 2, 2010
Custom image position within a TableViews Cell
View gist:724665
UIImageView *iconView = [[[UIImageView alloc] initWithFrame:CGRectMake(
50,
25,
24,
16
)] autorelease];
UIImage *iconImage = [UIImage imageNamed:@"eye.png"];
iconView.image = iconImage;
[[cell contentView] addSubview:iconView];