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 App.TaskItemController extends Spine.Controller | |
className: 'task-entry' | |
events: | |
'submit form.new-todo' : 'createTodo' | |
constructor: -> | |
super | |
@item.bind("destroy", @destroy) |
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
mongo <dbname> --eval "db.dropDatabase()" |
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
/* | |
This script is for updating the auto_increment field by an offset. The logic applied is | |
max(AUTO_INCREMENT) + current value in the table. | |
*/ | |
SET @db:='id_new'; | |
select @max_id:=max(AUTO_INCREMENT) from information_schema.tables; | |
select concat('update ',table_name,' set ', column_name,' = ',column_name,'+',@max_id,' ; ') from information_schema.columns where table_schema=@db and column_name like '%id' into outfile 'update_ids.sql'; |
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
<!-- all channels(approved) of the platform --> | |
<?xml version="1.1" encoding="UTF-8"?> | |
<channels> | |
<channel> | |
<name>网星电视</name> | |
<icon></icon> | |
<url>http://rokucndev.s3.amazonaws.com/channel-v.xml</url> | |
</channel> | |
</channels> |
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
set daemon 20 | |
set logfile syslog facility log_daemon | |
set mailserver smtp.gmail.com port 587 | |
username "ERROR-EMAIL-ADDRESS" password "PASSWORD" | |
using tlsv1 | |
with timeout 30 seconds | |
set alert ERROR-EMAIL-ADDRESS | |
set httpd port 2812 and |
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
guard 'jasmine', :timeout => 30000 do | |
watch(%r{app/assets/javascripts/(.+)\.(js\.coffee|js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.#{m[2]}" } | |
watch(%r{spec/javascripts/(.+)_spec\.(js\.coffee|js|coffee)$}) { |m| puts m.inspect; "spec/javascripts/#{m[1]}_spec.#{m[2]}" } | |
watch(%r{spec/javascripts/spec(_helper)?\.(js\.coffee|js|coffee)$}) { "spec/javascripts" } | |
watch(%r{spec/javascripts/support}) { "spec/javascripts" } | |
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
str =~ /\p{Han}+/u |
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
angular.directive "emailAvailable", ($http, $timeout) -> | |
require: 'ngModel' | |
link: (scope, elem, attrs, ctrl) -> | |
console.log ctrl | |
# push the validator on so it runs last. | |
ctrl.$parsers.push (viewValue) -> | |
# set it to true here, otherwise it will not | |
# clear out when previous validators fail. | |
ctrl.$setValidity "emailAvailable", true | |
if ctrl.$valid |
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 DailymotionParser | |
URLS = [ | |
/^.+dailymotion.com\/(video|hub)\/([^_]+)([^#|^?]*)(#video=([^_&]+))?/ | |
] | |
def self.parse url | |
case url | |
when URLS[0] | |
match_data = url.match(URLS[0]) |
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
facets: { | |
"brand_id" :{ | |
"_type"=>"terms", | |
"missing"=>46573, | |
"total"=>63247, | |
"other"=>1027, | |
"terms"=>[ | |
{"term"=>"14", "count"=>33889}, | |
{"term"=>"10", "count"=>23961}, | |
{"term"=>"37", "count"=>1044}, |