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
require_relative './helper' | |
require 'rdiff' | |
require 'tempfile' | |
describe RDiff do | |
it "should produce signature file consistently" do | |
file = Tempfile.new 'test' | |
file.write "blah blah blah" |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <librsync.h> | |
int | |
main() | |
{ | |
FILE *base, *sig; | |
base = fopen("oldfile", "rb"); | |
sig = fopen("sigfile", "wb"); |
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
diff -crB librsync-0.9.7/delta.c librsync-0.9.7-new/delta.c | |
*** librsync-0.9.7/delta.c 2004-09-18 05:35:49.000000000 +0800 | |
--- librsync-0.9.7-new/delta.c 2012-03-05 23:03:56.000000000 +0800 | |
*************** | |
*** 125,136 **** | |
static rs_result rs_delta_s_flush(rs_job_t *job); | |
static rs_result rs_delta_s_end(rs_job_t *job); | |
void rs_getinput(rs_job_t *job); | |
! inline int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len); | |
! inline rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len); |
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
NoMethodError in Users#new | |
Showing /app/app/views/users/_sign_up_form.html.haml where line #11 raised: | |
undefined method `username' for #<User:0x00000006b31c98> | |
Extracted source (around line #11): | |
8: .clearfix | |
9: = f.label :username | |
10: .input= f.text_field :username |
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
= form_for user do |f| | |
- if user.errors.any? | |
.error_messages | |
Form is invalid | |
%ul | |
- for message in user.errors.full_messages | |
%li= message | |
.clearfix | |
= f.label :username | |
.input= f.text_field :username |
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
%h1 | |
Sign Up | |
= render :partial => 'sign_up_form', :locals => { :user => @user } |
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 UsersController < ApplicationController | |
before_filter :authenticate_user!, :only => [:edit, :update] | |
respond_to :html, :json | |
def index | |
#@users = User.all | |
return if current_user.nil? | |
@users = current_user | |
respond_with @users |
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
33 respond_to :json¬ | |
34 def update¬ | |
35 @resume = current_user.resumes.find params[:id]¬ | |
36 ¬ | |
37 key = params[:model]¬ | |
38 hash_id = params[key]['hash_id']¬ | |
39 params[key][:start_date] = Time.utc params[key][:start_date][:year], \¬ | |
40 params[key][:start_date][:month] if params[key].has_key? :start_date¬ | |
41 params[key][:end_date] = Time.utc params[key][:end_date][:year], \¬ | |
42 params[key][:end_date][:month] if params[key].has_key? :end_date¬ |
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
$ -> | |
# clear all caches | |
localStorage.clear() | |
list = new List('#overview li.item') | |
$('#overview li.add a').live 'click', (e) -> e.preventDefault(); list.add $(this).closest('li.add') | |
$('#overview li.item a').live 'click', (e) -> e.preventDefault(); list.select $(this).closest('li.item') | |
# Save to server |
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
from Queue import Queue | |
from watchdog.observers import Observer | |
from watchdog.events import LoggingEventHandler, FileSystemEventHandler | |
class CMQueue(Queue, FileSystemEventHandler): | |
def __init__(self): | |
Queue.__init__(self) | |
FileSystemEventHandler.__init__(self) |