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
| ClientDashboard::Application.routes.draw do | |
| namespace :admin do | |
| resources :brands | |
| resources :email_messages | |
| resources :users | |
| resources :memberships do | |
| post 'new_by_brand', :on => :collection | |
| end | |
| resources :clients do |
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 <string.h> | |
| char* reverse(char *s) | |
| { | |
| int i, placeholder; | |
| int l = strlen(s) - 1; | |
| for(i = 0; i < (l / 2); i++){ | |
| placeholder = *(s+i); | |
| *(s+i) = *(s+l-i); |
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
| SELECT | |
| date(created_at) as ordered_date, | |
| sum(price) as total_price | |
| FROM | |
| orders | |
| GROUP BY | |
| date(created_at) | |
| HAVING | |
| sum(price) > 100 |
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 Array | |
| def extract_options! | |
| last.is_a?(::Hash) ? pop : {} | |
| end | |
| end | |
| def match(*args) | |
| rules = args.extract_options! | |
| if rules.has_key?(*args) | |
| rules[*args].call |
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
| def pmap &block | |
| if size > 0 | |
| match self.shape, | |
| head_tail: ->{ self.tail.pmap(&block).unshift yield(self.head) }, | |
| head: ->{ [ yield(self.head) ] } | |
| else | |
| self | |
| end | |
| end | |
| end |
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 Array | |
| def extract_options! | |
| last.is_a?(::Hash) ? pop : {} | |
| end | |
| def tail | |
| head, *tail = *self | |
| tail | |
| end |
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
| char* format_time(time_t t) | |
| { | |
| char formatted_time[64]; | |
| struct tm *ts; | |
| strftime(formatted_time, sizeof formatted_time, "%Y-%m-%d %H:%M:%S", ts); | |
| return formatted_time; | |
| } |
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
| hash_table.c:165:3: error: expected ')' | |
| assert(code == LL_DELETE_OK); | |
| ^ | |
| hash_table.c:165:18: note: instantiated from: | |
| assert(code == LL_DELETE_OK); | |
| ^ | |
| hash_table.c:7:23: note: instantiated from: | |
| #define LL_DELETE_OK 0; | |
| ^ | |
| hash_table.c:165:3: note: to match this '(' |
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
| Undefined symbols for architecture x86_64: | |
| "_linked_list_put", referenced from: | |
| _main in ccUFU1uN.o | |
| "_print_linked_list", referenced from: | |
| _main in ccUFU1uN.o | |
| "_key_position", referenced from: | |
| _main in ccUFU1uN.o | |
| "_linked_list_get", referenced from: | |
| _main in ccUFU1uN.o | |
| "_linked_list_delete", referenced from: |
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
| def work_weeks_for_date_range(date_range) | |
| {}.tap do |result| | |
| date_range.each do |date| | |
| result.store(date, WorkWeek.where(user_id: id, cweek: date.cweek, year: date.year, project_id: projects.for_company(current_company_id).map(&:id))) | |
| end | |
| end | |
| end |