Skip to content

Instantly share code, notes, and snippets.

@Znow
Znow / RoundBorderDatePicker.cs
Last active October 8, 2022 09:44 — forked from jessejiang0214/RoundBorderDatePicker.cs
This is the Xamarin Forms date picker extension. It can set border width, color and radius, also it can add PlaceHolder and MinimumAge. Updated to 2.5 requirements
using System;
using Xamarin.Forms;
namespace MyApp
{
public interface ICanBeValidated
{
Action<bool> ValidateChange { get; set; }
bool IsValidated { get; set; }
# /etc/nginx/sites-enabled/berlin
upstream spree.ryanbigg.com {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/berlin.socket fail_timeout=0;
}
@Znow
Znow / contact.php
Created October 8, 2012 09:02
If a item is clicked, record a session about that item
<?php session_start(); $_SESSION; ?>
[two-thirds-column]
<h3>Har du spørgsmål?</h3>
Så kontakt os på nedenstående formular og vi vil besvare hurtigst muligt.
[contact-form]
[/two-thirds-column]
[one-third-column]
$('.personality-rating').raty({
starOff    : 'star-off.png',
starOn     : 'star-on.png',
path : '/assets/',
space : false,
width : 100,
score : $('.personality-rating').data('rating'),
click : function(score, evt) {
var url = '/admin/contractors/' + $('.rating-header').attr('id') + '/rating';
console.log('ID: ' + $(this).attr('id') + '\nscore: ' + score + '\nevent: ' + evt + '\nurl: ' + url);
def update
@task = Task.find_by_id(params[:id])
respond_to do |format|
if @task.update_attributes(params[:task])
flash[:success] = "<strong>Success!</strong> #{@task.subject} was successfully edited.".html_safe
end
format.js { render :template => "admin/tasks/update.js.erb",
:locals => { :task => @task, :redirect_path => } #admin_tasks_path
} # update.js.erb
<div id="createTask<%= task.id %>" class="modal hide fade custom_modal" style="display: none; ">
<%= form_for [:admin, task], :url => admin_task_path(task.id), :remote => true, :html => { :id => "new-task-form" } do |f| %>
<div class="modal-header">
<h3>
Add New Task
<span class="pull-right">
<%= submit_tag "Save", :class => 'btn btn-primary custom_button' %>
<a href="#" data-dismiss="modal" class="btn btn-small custom_button_dark">Cancel</a>
</span>
</h3>
Started POST "/admin/tasks" for 127.0.0.1 at 2012-04-30 11:58:53 +0200
Processing by Admin::TasksController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"6Rb8LRbmnOqdSUqQ+xJfyOHinwlLYThvfksXoTicIoQ=", "task"=>{"task_type"=>"Follow-up", "subject"=>"dsadsadsadsa", "responsible"=>"1", "client"=>"3", "deadline"=>"2012-04-30 11:58"}, "commit"=>"Save"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Completed 500 Internal Server Error in 2ms
ActiveRecord::AssociationTypeMismatch (Client(#70287180650000) expected, got String(#70287161020800)):
app/controllers/admin/tasks_controller.rb:25:in `new'
app/controllers/admin/tasks_controller.rb:25:in `create'
<div id="createTask" class="modal hide fade custom_modal" style="display: none;">
<%= form_for [:admin, task], :url => admin_tasks_path, :remote => true, :html => { :id => 'new-task-form' } do |f| %>
<div class="modal-header">
<h3>
Add New Task
<span class="pull-right">
<%= submit_tag "Save", :class => 'btn btn-primary custom_button' %>
<a href="#" data-dismiss="modal" class="btn btn-small custom_button_dark">Cancel</a>
</span>
</h3>
<% content_for :modal_partials do %>
<%= render :partial => "/admin/tasks/edit_task_modal", :locals => {:task => t} %>
<%= render :partial => "/admin/tasks/delete_task_modal", :locals => {:task => t} %>
<% end %>
<%# content_for :pre_body_close do
<script>
alert('hej')
$(".completed").live("change", function(el) {
$.ajax({
<tr>
<td>
<%= check_box_tag "completed", t.id, t.completed, :class => "completed" %>
</td>
<td><%= t.task_type %></td>
<td><%= link_to "#{truncate(t.subject, :length => 20)}", admin_task_path(t) %></td>
<td><%= t.responsible(&:name) %></td>
<td><%= link_to t.client, admin_client_path(t.client) unless t.client.nil? %></td>
<td><%= t.deadline.strftime("%d/%m/%y %H:%M") %></td>
<td><%= t.author(&:name) %></td>